これはちょっと変わった問題です!UIAppearance API を使用して UITableViewCells のスタイルを設定しています。次のコードを使用して、UITableViewCell のスタイルを設定します。
// table cell
id tableCellAppearance = [UITableViewCell appearance];
[tableCellAppearance setBackgroundView:[theme imageViewForTableViewCellBackground]];
// table cell
-(UIImageView *) imageViewForTableViewCellBackground
{
UIImageView *backgroundView = [[UIImageView alloc] init];
[backgroundView setImage:[UIImage imageNamed:@"tile_heading_background"]];
return backgroundView;
}
アプリを実行して UITableViewCells を見ると、UITableView でスタイル設定されているセルは 1 つだけです。真ん中のセル。何故ですか?