-4

如何更改点击表格视图单元格时显示的默认(蓝色)颜色?
(只是覆盖颜色,当您点击 Settings.app 中的一个选项时,它会在将您带到那里之前变为蓝色)

4

2 回答 2

4

选定的背景视图

选中时用作单元格背景的视图。

@property(nonatomic, retain) UIView *selectedBackgroundView

来自UITableViewCell 类参考

制作一个UIView,设置任何backgroundColor你想要的并将其设置selectedBackgroundView为你的单元格。

于 2012-06-25T15:36:27.963 回答
3

你可以使用其中任何一个

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
//or
[cell setSelectionStyle:UITableViewCellSelectionStyleGray];

也许这会帮助你

于 2012-06-25T15:37:18.187 回答