Tek bir görünüm projesi oluşturdum ve bir koleksiyonView ekledim. Ben öziOS11 UICollectionSectionHeader kırpma kaydırma göstergesi
extension ViewController: UICollectionViewDataSource {
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 100
}
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: kHeader, for: indexPath)
return headerView
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
cell.backgroundColor = UIColor.blue
return cell
}
}
extension ViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
return CGSize(width: collectionView.bounds.width, height: 88)
}
}
için UICollectionReusableView
final class TestReusableView: UICollectionReusableView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor.red
}
...
}
Seti veri kaynağı ve temsilci basit alt sınıfı kayıtlı sonuç bölüm başlığı dikey kaydırma göstergesi yukarıda konumlandırılmış gibi görünüyor olduğunu. Ancak, uygulamayı 10.3.1 simülatörüne karşı çalıştırırsam, davranış beklediğim gibi çalışır.
Ben de bölüm başlığı tüm görünümlerde yukarıda konumlandırılmış iOS 11.0 ile benzer bir sorun karşılaştım. Her şey 10.3'te iyi çalışıyor. – Aks
Kesinlikle iOS 11.0+ sürümü gibi görünüyor. Ben de içine koşuyorum. Bunu bulabildiğim en yakın RADAR: http://www.openradar.me/34308893 – isoiphone