「UITableView」カテゴリーアーカイブ

TableViewCellの選択時の背景色を変更する


TableViewCellをタップすると、デフォルト設定では背景が青に変化します。以下のように記述すると、タップ時に背景色が緑に変化するようになります。

UIView *bgView = [[UIView alloc] init];
[bgView setBackgroundColor:[UIColor greenColor]];
[cell setSelectedBackgroundView:bgView];

参考: How to change the blue highlight color of a UITableViewCell?