【发布时间】:2016-06-15 07:46:00
【问题描述】:
我已经使用 alpha 成功更改了 UIButton 的颜色,但是当我尝试对我的 tableview 执行相同操作时,它不起作用。
_tablemenu.layer.borderWidth = 2;
_tableview.layer.borderWidth = 5;
_tableview.layer.borderColor = [UIColor colorWithRed:0xCC green:0xFF blue:0x99 alpha:0.5].CGColor;
_tablemenu.layer.borderColor = [UIColor greenColor].CGColor;
代码在 _tablemenu 上运行良好,但是当我尝试使用 RGB 值初始化 UIColor 时,它不起作用。
【问题讨论】:
-
colorWithRed:green:blue:alpha:需要介于 0 和 1 之间的值。所以将该值除以 255。 -
@Larme 好的,我会试试...
-
你在为你的 tableview 或 tableview 单元格尝试吗..?
-
@Anbu.Karthik uitableview 兄弟..
标签: ios objective-c uitableview uicolor cgcolor