У меня есть одна строка collectionview
, которая прокручивает по горизонтали. Работает collectionview
, но он отсекает вторую по последнюю ячейку (помечен оранжевым) и скрывает последнюю ячейку.iOS Horizontal CollectionView не прокручивается полностью
У меня есть 5 ячеек, каждая из размера 166x166. Я проверил contentsize
viewlayout
, и его ширина равна 830, что является правильным, но я не могу прокрутить это далеко.
Вот настройки в раскадровке:
А вот код collectionview
.
#pragma mark Collection View Methods
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return [array count];
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"FeaturedCell" forIndexPath:indexPath];
UILabel *label = (UILabel *) [cell viewWithTag: 100];
label.text = [array objectAtIndex:indexPath.row];
[cell.layer setBorderWidth:2.0f];
[cell.layer setBorderColor:[UIColor whiteColor].CGColor];
return cell;
}
Вы используете UICollectionView или UICollectionViewController? Если вы используете представление коллекции, возможно, часть его кадра заканчивается с экрана. –
Я использую UICollectionView в ViewController –