के लिए पंक्ति और कॉलम संख्या निर्दिष्ट करें, मैं एक UICollectionView दिखाना चाहता हूं जिसमें प्रत्येक पंक्ति में बिल्कुल 2 पंक्तियां और 100 कक्ष शामिल हैं।UICollectionView
मैं कैसे UICollectionView के लिए एक पंक्ति संख्या निर्दिष्ट कर सकते हैं:
// 1
- (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section {
return 100;
}
// 2
- (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView {
return 2;
}
// 3
- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath {
MyCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.lbl.text = @"Data";
return cell;
}
मैं इस मिल रहा है? मैं एक 2x100 टेबल बनाना चाहता हूँ।
आपको बहुत बहुत धन्यवाद ... – onivi
यह गलत लगता है – aelam
कस्टम लेआउट का उपयोग करना बेहतर है: http://stackoverflow.com/a/35362818/833885 – brianLikeApple