[英]How do I add a UICollectionView inside a UICollectionViewCell?
[英]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.