V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
tsinghan
V2EX  ›  iOS

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

  •  
  •   tsinghan · Mar 30, 2015 · 3436 views
    This topic created in 4047 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
        1
    eternityz  
       Mar 30, 2015
    - [UICollectionViewFlowLayout headerReferenceSize]

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