objective-c - 设置UICollectionViewFlowLayout的minimumLineSpacing不起作用怎么回事?
巴扎黑
巴扎黑 2017-05-02 09:38:10
[iOS讨论组]

UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];

layout.minimumLineSpacing =10.0f;
 //2.初始化collectionView
_homeCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, Screen_width , Screen_height - 117) collectionViewLayout:layout];


代码是这样,不知道是什么原因引起minimumLineSpacing属性失效的

巴扎黑
巴扎黑

全部回复(1)
伊谢尔伦

If the delegate object does not implement the
collectionView:layout:minimumLineSpacingForSectionAtIndex: method, the
flow layout uses the value in this property to set the spacing between
lines in a section.

For a vertically scrolling grid, this value represents the minimum
spacing between successive rows. For a horizontally scrolling grid,
this value represents the minimum spacing between successive columns.
This spacing is not applied to the space between the header and the
first line or between the last line and the footer.

The default value of this property is 10.0.

原因有很多,是否时实现了设置minimumLineSpacing的delegate,还和collectionView的滑动方向有关。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号