Comment limiter UICollectionViewCell
à 10 ou 20? Si UICollectionViewCell
charger autant de cellules à partir de l'API.Comment limiter UICollectionViewCell
-(NSInteger) numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
-(NSInteger) collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.items.count;
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
static NSString *identifier = @"Cell";
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
eventisi* list = [_items objectAtIndex:indexPath.row];
UIImageView *iconEvent = (UIImageView*)[cell viewWithTag:1];
NSURL *url = [NSURL URLWithString:list.EVENT_IMAGE];
[iconEvent setImageWithURL:url usingActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
iconEvent.clipsToBounds = YES;
// Configure the cell
UILabel *judul = (UILabel *)[cell viewWithTag:2];
judul.text = list.EVENT_NAME;
judul.numberOfLines =2;
judul.lineBreakMode = NSLineBreakByWordWrapping;
judul.font = [UIFont systemFontOfSize:10];
return cell;
}
Peut-être que vous pouvez revenir dans moins d'éléments 'numberOfItemsInSection'. – rmaddy