0
我已經使用水平收集視圖來滾動UILabel。在我的陣列中,我有30件物品。當我滾動到第30個項目時,它應該再次顯示第一個項目,就像一個圓形滾動。以下是我想要實現的代碼和圖像。如何包裝UICollectionView
- (NSInteger) collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return self.waitListArray.count;
}
- (UICollectionViewCell *) collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
WaitListWarningTimeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCollectionViewIdentifier forIndexPath:indexPath];
cell.lblWaitingTime.text = [NSString stringWithFormat:@"%@m", self.waitListArray[indexPath.row]];
if ([self.waitListArray[indexPath.row] intValue]==0) {
cell.lblWaitingTime.text = @"Off";
}
if (indexPath.row == self.selectedIndex)
{
cell.lblWaitingTime.textColor = [UIColor blackColor];
}
else
{
cell.lblWaitingTime.textColor = [UIColor lightGrayColor];
}
return cell;
}