我想在我的项目中使用NSAttributedString
,但是当我尝试设置不是标准设置的颜色(redColor
,blackColor
,greenColor
等)时,UILabel
会以白色显示这些字母。 这是我的这段代码。如何从RGBA创建UIColor?
[attributedString addAttribute:NSForegroundColorAttributeName
value:[UIColor colorWithRed:66
green:79
blue:91
alpha:1]
range:NSMakeRange(0, attributedString.length)];
我试图使色彩搭配CIColor
从核心图像框架,但它显示了同样的结果。 我应该更改我的代码以正确的方式执行它?
Thx for answers,guys!
它工作得很好,现在我觉得自己像白痴这样的错误了!谢谢! – x401om