collectionview 使用 flow layout 时, header 的高度, 有方法设置吗?

2015-03-30 09:06:37 +08:00
 tsinghan

collectionview 使用 flow layout时, header的高度, 有方法设置吗?

2773 次点击
所在节点    iOS
5 条回复
eternityz
2015-03-30 09:33:28 +08:00
- [UICollectionViewFlowLayout headerReferenceSize]

- [UICollectionViewDelegateFlowLayout collectionView:layout:referenceSizeForHeaderInSection:]
tsinghan
2015-03-30 10:05:35 +08:00
@eternityz 这方法是UICollectionViewDelegateFlowLayout 协议里面的, 我现在是 默认的flow layout, 没有自定义layout,所以就没有实现UICollectionViewDelegateFlowLayout协议~~
eternityz
2015-03-30 10:23:54 +08:00
@tsinghan 那就用第一个方法, - [myFlowLayout setHeaderReferenceSize:]
vincentxue
2015-03-31 09:38:31 +08:00
@tsinghan 默认的 flow layout 不就是 UICollectionViewFlowLayout 吗... UICollectionViewDelegateFlowLayout 是遵循 UICollectionViewDelegate 协议的。
tsinghan
2015-04-02 09:01:53 +08:00
@vincentxue 恩, 实现这个协议, 就好了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/180234

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX