开发者

UITableViewCell background color only working with the preset color methods

开发者 https://www.devze.com 2023-04-06 03:02 出处:网络
Have some very strange thing happening to me with a UITableViewCell background and was hoping if someone knows whether this is a bug.

Have some very strange thing happening to me with a UITableViewCell background and was hoping if someone knows whether this is a bug.

If I set my UITableView and the UITableViewCell background colors to one of the preset color methods (whiteColor, blackColor开发者_开发问答, etc) it works fine and all the rows take the necessary color. Yet, when I use either the colorWithRed:green:blue:alpha or colorWithHue:saturation:brightness:alpha I always end up getting a white background for the table.

Is this a bug in Apple’s code or am I just missing something?


what are you putting into red:green:....

I've seen lots of examples where they use ints or 0-255 and this isn't correct.

[UIColor colorWithRed:0.3 green:0.2 blue:0.2 alpha:1.0]

they should be in the range of 0-1

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号