我正在设置我的 uitableviewCell 的背景颜色,例如
cell.contentView.backgroundColor = [UIColor colorWithRed:8.0 green:210.0 blue:11.0 alpha:1.0];
但是,如果我喜欢,它不起作用
cell.contentView.backgroundColor = [UIColor grayColor];
然后就可以了。任何帮助
我正在设置我的 uitableviewCell 的背景颜色,例如
cell.contentView.backgroundColor = [UIColor colorWithRed:8.0 green:210.0 blue:11.0 alpha:1.0];
但是,如果我喜欢,它不起作用
cell.contentView.backgroundColor = [UIColor grayColor];
然后就可以了。任何帮助
UIColor
必须在 0 和 1 之间定义才能使RGB值起作用(UIColor 类参考):
cell.contentView.backgroundColor = [UIColor colorWithRed:8.0f/255.0f green:210.0f/255.0f blue:11.0f/255.0f alpha:1.0f];