12207480 / TYCyclePagerView

a simple and usefull cycle pager view ,and auto scroll banner view(轮播图) ,include pageControl for iOS,support Objective-C and swift
MIT License
1.8k stars 331 forks source link

布局问题 #56

Closed kaqise closed 6 years ago

kaqise commented 6 years ago

把TYCyclePagerView放到UICollectionViewCell中,布局错乱

12207480 commented 6 years ago

有demo 或者 图片吗

YaoJuan commented 6 years ago

我遇到了同样的问题,是把banner当成了tableView的子视图,会报很多冲突错误。 UICollectionViewFlowLayout instance is <TYCyclePagerTransformLayout: 0x10633a350>, and it is attached to <UICollectionView: 0x10709ae00; frame = (0 0; 414 198.72); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x2812349c0>; layer = <CALayer: 0x281c1d000>; contentOffset: {94547.333333333328, 0}; contentSize: {285515.00000000035, 198.72000122070312};

YaoJuan commented 6 years ago

可能我的问题和主楼的说的不是同一个,我是由于banner的父视图是个cell,然后我是根据数据算完cell的高度,然后把这个高度赋值给banner的itemSize。不知道为何导致会出现小数点后面取整不一致,不过我已经解决了。在算高的时候我直接floor取值了