tsinghan
V2EX  ›  iOS

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

  •  
  •   tsinghan · Mar 30, 2015 · 3940 views
    This topic created in 4260 days ago, the information mentioned may be changed or developed.

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

    5 replies  •  2015-04-02 09:01:53 +08:00
    eternityz
    eternityz
    Mar 30, 2015
    1
    - [UICollectionViewFlowLayout headerReferenceSize]

    - [UICollectionViewDelegateFlowLayout collectionView:layout:referenceSizeForHeaderInSection:]
    tsinghan
    tsinghan
    OP
    Mar 30, 2015
    2
    @eternityz 这方法是UICollectionViewDelegateFlowLayout 协议里面的, 我现在是 默认的flow layout, 没有自定义layout,所以就没有实现UICollectionViewDelegateFlowLayout协议~~
    eternityz
    eternityz
    Mar 30, 2015
    3
    @tsinghan 那就用第一个方法, - [myFlowLayout setHeaderReferenceSize:]
    vincentxue
    vincentxue
    Mar 31, 2015
    4
    @tsinghan 默认的 flow layout 不就是 UICollectionViewFlowLayout 吗... UICollectionViewDelegateFlowLayout 是遵循 UICollectionViewDelegate 协议的。
    tsinghan
    tsinghan
    OP
    Apr 2, 2015
    5
    @vincentxue 恩, 实现这个协议, 就好了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3379 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 04:08 · PVG 12:08 · LAX 20:08 · JFK 23:08
    ♥ Do have faith in what you're doing.