问题描述
我在情节提要中有一个 UICollectionViewController
.我知道如何添加单元格并修改它们,但由于某种原因,我无法在 UICollectionView
之后添加任何其他视图或 UI 元素.
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 my UICollectionView
.
有没有办法在故事板中做到这一点?如果不是,我该如何以编程方式执行此操作?
Is there a way to do this in the storyboard? If not how can I do this programmatically?
推荐答案
在情节提要中,您可以通过为您的 UICollectionView 选择单选按钮标题Section Footer"来启用它,然后将 UIButton 拖到那里.你也可以重写这个函数:
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
如果你是UICollectionViewFlowLayout
这篇关于在情节提要的集合视图末尾添加按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!