【问题标题】:BackgroundColor of UItableviewCell NotworkingUItableviewCell 的背景颜色不起作用
【发布时间】:2014-06-23 15:09:26
【问题描述】:

我正在设置我的 uitableviewCell 的背景颜色,例如

 cell.contentView.backgroundColor = [UIColor colorWithRed:8.0 green:210.0 blue:11.0 alpha:1.0];

不过,如果我喜欢,它就不起作用了

 cell.contentView.backgroundColor = [UIColor grayColor];

然后就可以了。任何帮助

【问题讨论】:

标签: ios uitableview uibackgroundcolor


【解决方案1】:

UIColor 必须定义为介于 0 和 1 之间才能使 RGB 值起作用 (UIColor class reference):

cell.contentView.backgroundColor = [UIColor colorWithRed:8.0f/255.0f green:210.0f/255.0f blue:11.0f/255.0f alpha:1.0f];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-01
    • 2014-07-20
    • 2012-06-05
    • 1970-01-01
    • 1970-01-01
    • 2014-04-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多