有谁知道如何使用 UITableViewCell 更改每个选定单元格的背景颜色?我在 TableView 的代码中创建了这个 UITableViewCell。
最佳答案
更改属性 selectedBackgroundView 是正确且最简单的方法。我使用以下代码来更改选择颜色:
// set selection color
UIView *myBackView = [[UIView alloc] initWithFrame:cell.frame];
myBackView.backgroundColor = [UIColor colorWithRed:1 green:1 blue:0.75 alpha:1];
cell.selectedBackgroundView = myBackView;
[myBackView release];
关于iphone - 更改所选单元格的背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2418189/