V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
tsinghan
V2EX  ›  iOS

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

  •  
  •   tsinghan · 2015-03-30 09:06:37 +08:00 · 2765 次点击
    这是一个创建于 3314 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    5 条回复    2015-04-02 09:01:53 +08:00
    eternityz
        1
    eternityz  
       2015-03-30 09:33:28 +08:00
    - [UICollectionViewFlowLayout headerReferenceSize]

    - [UICollectionViewDelegateFlowLayout collectionView:layout:referenceSizeForHeaderInSection:]
    tsinghan
        2
    tsinghan  
    OP
       2015-03-30 10:05:35 +08:00
    @eternityz 这方法是UICollectionViewDelegateFlowLayout 协议里面的, 我现在是 默认的flow layout, 没有自定义layout,所以就没有实现UICollectionViewDelegateFlowLayout协议~~
    eternityz
        3
    eternityz  
       2015-03-30 10:23:54 +08:00
    @tsinghan 那就用第一个方法, - [myFlowLayout setHeaderReferenceSize:]
    vincentxue
        4
    vincentxue  
       2015-03-31 09:38:31 +08:00
    @tsinghan 默认的 flow layout 不就是 UICollectionViewFlowLayout 吗... UICollectionViewDelegateFlowLayout 是遵循 UICollectionViewDelegate 协议的。
    tsinghan
        5
    tsinghan  
    OP
       2015-04-02 09:01:53 +08:00
    @vincentxue 恩, 实现这个协议, 就好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5391 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 07:34 · PVG 15:34 · LAX 00:34 · JFK 03:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.