正確に 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 テーブルを作成したい。