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


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

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

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

Comments

comments

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です