Как добавить UIActivityIndicatorView
в нижний колонтитул UICollectionView
в swift? Для UITableView
это было всего лишь self.tableView.tableFootView = self.myActivityIndicatorView
. Это возможно? Если да, то как?Как добавить UIActivityIndicatorView в нижний колонтитул UICollectionView?
5
A
ответ
1
Создание вида класса и добавить индикацию активности в этой точке зрения
Зарегистрируйте этот класс как вид сноска класса с помощью:
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
}