私はUICollectionViewを使用して、iPadでグリッドベースのビューを表示しています。画面には一度に200(20行x 10列)のセルしかありません。各セルには1つのUILabelのみが含まれています。TableViewのように、スクロールが遅くなり、スムーズになりません。
このスクロールパフォーマンスが遅い理由はわかりません。どうすれば改善できますか?
前もって感謝します!
私は3つのcollectionviewsを持っていますが、メインコンテンツのuicollectionviewは2とタグ付けされたものです。これが私のコードです
if (collectionView.tag==0) { //This tagged collection view is for Left side selection box
LeftSelectionBoxItem *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SelectionCell" forIndexPath:indexPath];
return cell;
}
else if (collectionView.tag==1){ //This tagged collection view is for to show column names
TopColumnItem *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ColumnCell" forIndexPath:indexPath];
cell.columnName.text = [NSString stringWithFormat:@"%@",[self.columnNames objectAtIndex:indexPath.item]];
return cell;
}
else if (collectionView.tag==2) { //This tagged collection view is for to show main content
GridItem *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GridCell" forIndexPath:indexPath];
cell.dataLabel.text = [NSString stringWithFormat:@"%@",[[self.dataModel objectAtIndex:indexPath.section] objectForKey:[self.columnNames objectAtIndex:indexPath.item]]];
return cell;
}
else {
return nil;
}