मैं अपने शीर्षक और वास्तविक आइटम, जो वर्तमान में इस तरह दिखेगा के बीच कुछ अंतर जोड़ना चाहते हैं:UICollectionView: हेडर और आइटम के बीच अंतर को जोड़ने
func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
// Create header
switch kind{
case UICollectionElementKindSectionHeader:
let headerView = iconCollectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "customIconHeaderView", forIndexPath: indexPath) as! CustonIconHeaderView
headerView.setUp() //add whatever into the view
return headerView
default:
assert(false, "Unexpected element kind")
}
}
जो कि हेडर की ऊंचाई में वृद्धि हुई है, मैं हेडर के लिए एक कस्टम दृश्य का उपयोग कर रहा हूं, हालांकि मुझे नहीं पता कि यह – Liumx31
पर कुछ भी प्रभावित करता है उदाहरण के लिए, आपका कस्टम हेडर व्यू '40' pt ऊंचाई है और' संदर्भ आकारफोरहेडर इनसेक्शन' '60' है जो नीचे दिए गए '20' pt अंतर को प्रदान करेगा यदि आप अपना कस्टम हेडर व्यू' फ्रेम 'सही तरीके से सेट करते हैं :) – Breek
मैं कस्टम व्यू की ऊंचाई कैसे सेट करूं, मैं कोड में सबकुछ कर रहा हूं। क्या मैं इसे 'viewForSplementmentElementOfKind' में करता हूं? – Liumx31