Chcę wyświetlić UICollectionView, który zawiera dokładnie 2 wiersze i 100 komórek w każdym wierszu.Określ numer wiersza i kolumny dla 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;
}
jestem coraz to:
Jak mogę określić numer wiersza dla UICollectionView? Chcę utworzyć tabelę 2x100.
Dziękuję bardzo ... – onivi
wydaje się nieprawidłowy – aelam
Lepiej jest używać niestandardowego układu: http://stackoverflow.com/a/35362818/833885 – brianLikeApple