0
让我们直接点。我需要一个带有两个彩色文字的UIButton
。我知道我可以使用`NSAttributeStrings属性来做到这一点,但它不适用于ios 5.如何在iOS 5中使用多个颜色文本的titleLabel制作UIButton?
那么我怎样才能使它成为ios 5.0
?
到现在我已经做到了这一点:
NSDictionary *firstAttributes = @{NSForegroundColorAttributeName: [UIColor blackColor]
};
NSDictionary *secondAttributes = @{NSForegroundColorAttributeName: [UIColor redColor]
};
NSString *club = NSLocalizedString(@"club_button_concat_text", @"club_button_concat_text");
NSAttributedString *myString = [[NSAttributedString alloc] initWithString:club attributes:secondAttributes];