Я хочу показать UICollectionView, который содержит ровно 2 строки и 100 ячеек в каждой строке.Укажите номер строки и столбца для 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;
}
Я получаю это:
Как я могу указать номер строки для UICollectionView? Я хочу создать таблицу 2x100.
Большое спасибо ... – onivi
кажется неправильным – aelam
Лучше использовать пользовательский макет: http://stackoverflow.com/a/35362818/833885 – brianLikeApple