swift – 如何在UICollectionView的页脚中添加UIActivityIndi??c
发布时间:2020-12-14 04:56:05 所属栏目:百科 来源:网络整理
导读:如何在 swift中向UICollectionView的页脚添加UIActivityIndi??catorView?对于UITableView,它只是self.tableView.tableFootView = self.myActivityIndi??catorView.这可能吗?如果是这样,怎么样? 解决方法 在该视图中创建视图类并添加活动指示 使用以下命令
如何在
swift中向UICollectionView的页脚添加UIActivityIndi??catorView?对于UITableView,它只是self.tableView.tableFootView = self.myActivityIndi??catorView.这可能吗?如果是这样,怎么样?
解决方法
在该视图中创建视图类并添加活动指示
使用以下命令将此类注册为页脚视图类: registerClass(myFooterViewClass,forSupplementaryViewOfKind: UICollectionElementKindSectionFooter,withReuseIdentifier: "myFooterView") 在集合视图布局或实现上设置headerReferenceSize collectionView:layout:referenceSizeForHeaderInSection: in your delegate. 从dataSource中的以下方法返回页脚视图: func collectionView(collectionView: UICollectionView,viewForSupplementaryElementOfKind kind: String,atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView { let view = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionFooter,withReuseIdentifier: "myFooterView",forIndexPath: indexPath) // configure footer view return view } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |