繁体   English   中英

如何在UICollectionView的页脚中添加UIActivityIndi​​catorView?

[英]How do I add a UIActivityIndicatorView to footer of UICollectionView?

如何在swift中向UICollectionView页脚添加UIActivityIndicatorView 对于UITableView ,它只是self.tableView.tableFootView = self.myActivityIndicatorView 这可能吗? 如果是这样,怎么样?

在该视图中创建视图类并添加活动指示

使用以下命令将此类注册为页脚视图类:

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
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM