LvJianfeng / LLCycleScrollView

Swift - 轮播图,文本轮播,支持左右箭头
MIT License
373 stars 65 forks source link

图片出现错位,警告信息如下 #34

Closed tyz-coder closed 6 years ago

tyz-coder commented 6 years ago

2018-03-22 18:39:26.664765+0800 HaoDLSwift[2494:932542] The behavior of the UICollectionViewFlowLayout is not defined because: 2018-03-22 18:39:26.664863+0800 HaoDLSwift[2494:932542] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values. 2018-03-22 18:39:26.665880+0800 HaoDLSwift[2494:932542] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x10181eaa0>, and it is attached to <UICollectionView: 0x102090000; frame = (0 0; 375 200); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x17004d1d0>; layer = <CALayer: 0x170226540>; contentOffset: {0, -20}; contentSize: {0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x10181eaa0>. 2018-03-22 18:39:26.665949+0800 HaoDLSwift[2494:932542] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger. 2018-03-22 18:39:28.865031+0800 HaoDLSwift[2494:932542] The behavior of the UICollectionViewFlowLayout is not defined because: 2018-03-22 18:39:28.865207+0800 HaoDLSwift[2494:932542] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values. 2018-03-22 18:39:28.865972+0800 HaoDLSwift[2494:932542] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x10181eaa0>, and it is attached to <UICollectionView: 0x102090000; frame = (0 0; 375 200); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x17004d1d0>; layer = <CALayer: 0x170226540>; contentOffset: {0, -20}; contentSize: {375, 131}> collection view layout: <UICollectionViewFlowLayout: 0x10181eaa0>. 2018-03-22 18:39:28.866077+0800 HaoDLSwift[2494:932542] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

wechatimg1 2

tyz-coder commented 6 years ago

红色是scrollview 的背景色,图片明显向上偏移了 20,我找了 很久的问题,还是没改掉,但是我写了一个view放在你的控件下面,居然不报错也正常了。 你看一下我写的 wechatimg2 1

tyz-coder commented 6 years ago

ios 10.3.2 iphone 6 出现,模拟器 ios 11 不会出现

LvJianfeng commented 6 years ago

@tyzChar 您好,最近没怎么更新。 希望可以提供下初始化的代码,谢谢。