我正在使用TTAtributedLabel庫在標籤中使用多色以下代碼。TTAtributedLabel使用在MACRO標題中定義的UIColor設置多色?
[lifeEventLabel setText:tempString afterInheritingLabelAttributesAndConfiguringWithBlock:^(NSMutableAttributedString *mutableAttributedString) {
NSRange blueRage = [tempString rangeOfString:[tempDict valueForKeyPath:@"person.firstName"]];
if (blueRage.location != NSNotFound) {
// Core Text APIs use C functions without a direct bridge to UIFont. See Apple's "Core Text Programming Guide" to learn how to configure string attributes.
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(id)[UIColor blueColor].CGColor range:blueRage];
}
return mutableAttributedString;
}];
我的問題是,我已經採取了不斷的UIColor在一個頭文件有以下
#define TEXT_LINK_COLOR [UIColor colorWithRed:(68/255.0) green:(110/255.0) blue:(126/255.0) alpha:1];
,但現在的問題是,我不能用下面的方法訪問它給一個以上的顏色在的UILabel
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(id)[UIColor blueColor].CGColor range:blueRage];
字符串的一部分,所以誰能告訴我如何更換[UIColor blueColor].CGColor
使用上面時時彩在上面的線爲給我編誤差R現在呢?