在故事板中的集合视图末尾添加按钮 [英] Add button at the end of collection view in storyboard

查看:112
本文介绍了在故事板中的集合视图末尾添加按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在故事板中有一个 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?

推荐答案

在故事板中,您可以通过选择单选按钮标题Section Footer来启用它,为您的UICollectionView,然后在那里拖动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

这篇关于在故事板中的集合视图末尾添加按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆