मैंने एक एकल दृश्य प्रोजेक्ट बनाया और एक संग्रह दृश्य जोड़ा। मैं स्वयंआईओएस 11 यूआईसीओलेक्शनसेक्शन हैडर क्लिपिंग स्क्रॉल सूचक
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)
}
}
को UICollectionReusableView
final class TestReusableView: UICollectionReusableView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor.red
}
...
}
सेट डेटा स्रोत और प्रतिनिधि का एक सरल उपवर्ग पंजीकृत परिणाम अनुभाग शीर्ष लेख लंबवत स्क्रॉल सूचक ऊपर तैनात किया जा रहा है है। हालांकि, अगर मैं 10.3.1 सिम्युलेटर के खिलाफ ऐप चलाता हूं, तो व्यवहार काम करता है जैसा कि मैं उम्मीद करता हूं।
मैं भी आईओएस 11.0 जहां अनुभाग शीर्ष लेख सभी दृश्यों से ऊपर रखा जाता है के साथ इसी तरह इस मुद्दे का सामना करना पड़ा। सब कुछ 10.3 में ठीक काम करता है। – Aks
निश्चित रूप से आईओएस 11.0+ अंक की तरह दिखता है। मैं भी इसमें भाग रहा हूँ। निकटतम रडार मैं यह पा सकता हूं: http://www.openradar.me/34308893 – isoiphone