テーブル ビューに 10 行を入力します。表を上にスクロールすると、最初の 2 行または 3 行がしばらくフリーズします。最後の行が 2 ~ 3 秒間しか表示されません。テーブルをスクロールすると cellForRowAtIndexPath と willDisplayCell 関数が呼び出されることがわかりました。私はそれらの機能を使用しています。これらの関数の呼び出しにより、応答時間が短縮されているようです。テーブルをスクロールするときにこれらの関数の呼び出しを無効にするにはどうすればよいですか? スクロールを無効にしたくないことに注意してください。
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [[self.items objectAtIndex:indexPath.row] valueForKey:@"name"];
if ([indexPath row] % 2)
cell.backgroundColor = [UIColor whiteColor];
else
cell.backgroundColor = [UIColor colorWithRed:0/255.0 green:46/255.0 blue:59/255.0 alpha:0.1];
return cell;