UIActivityIndicatorView
UICollectionView
altbilgisine nasıl eklenir? UITableView
için, sadece self.tableView.tableFootView = self.myActivityIndicatorView
idi. Mümkün mü? Öyleyse nasıl?UICollectionView altbilgisine nasıl UIActivityIndicatorView eklerim?
5
A
cevap
1
görünümü sınıf oluşturun ve o görünüme
aktivite göstergesini eklemek Kayıt altbilgi görünümü sınıf olarak bu sınıfı kullanarak:
registerClass(myFooterViewClass, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "myFooterView")
Ya toplama görünüm düzeni üzerinde headerReferenceSize ayarlamak veya uygulamak
collectionView:layout:referenceSizeForHeaderInSection: in your delegate.
Altbilgi görünümünü veri kaynağınızda aşağıdaki yöntemden döndürün:
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
}