Add button at the end of collection view in storyboard

后端 未结 2 379
借酒劲吻你
借酒劲吻你 2020-12-10 09:09

I have a UICollectionViewController in a storyboard. I know how to add cells and modify them but for some reason I can\'t add any other view or UI element after

2条回答
  •  一生所求
    2020-12-10 09:58

    In storyboard you can enable it by selecting the radio button title "Section Footer", for your UICollectionView and then by dragging UIButton there. You can also override this function:

    - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath

    You may also need to set Footer's reference size if you are UICollectionViewFlowLayout

提交回复
热议问题