うわー、それは一口でしたか。:)
タブ バーの詳細メニュー (テーブル ビュー) のカスタマイズに関する適切なスレッドを既に確認しました。
次のトリックでは、表のセルに背景画像を追加するにはどうすればよいでしょうか?
More Table View の Data Source クラスでtableView:cellForRowAtIndexPath:をオーバーライドすることで回避できると思いました (方法論については、以前のリンクを参照してください)。残念ながら、画像の下の背景と各セルの左右のアクセサリ ビューのみが変更されます。
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Let the original Data Source get a hold of the cell first.
UITableViewCell *cell = [originalDataSource tableView:tableView cellForRowAtIndexPath:indexPath];
// If we override the textColor, that works fine. (Commented out for now.)
//cell.textLabel.textColor = [UIColor whiteColor];
// If we override the background view … that doesn't work so well.
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cellBackground.png"]];
return cell;
}
私は、imageNamed:が悪であることを知っています。おそらく、1 つの背景画像を作成し、それを全体で再利用する必要があります (複数のUIImageViewオブジェクトを割り当てるのではなく)。それらのアイテムとは別に、何か考えはありますか?(textLabel の backgroundColor も調整しようとしましたが、役に立ちませんでした…そこで何か間違ったことをしていない限り。)