3
目前我正在使用簡單的iPhone應用程序,使用UILabel顯示像Delivered minu這樣的名稱,我想要顯示兩種顏色(Deliverd)作爲黑色和(minu)作爲藍色,可能嗎?請幫幫我。是否有可能在iphone中設置兩個顏色inUILabel?
進展得益於
我試過,但我不能修復此:
deliveredLabel.text = [NSString stringWithFormat:@"Delivered"];
deliveredLabel.textColor = [UIColor blackColor];
nameLabel.text = [NSString stringWithFormat:@"Minu"];
nameLabel.text.textColor = [UIColor blueColor];
label.text = [NSString stringWithFormat:@"%@ %@",deliveredLabel.text,name.text];
也許蘋果公司會在即將到來的iOS版本中解決這個問題? – jrturton 2012-07-18 05:57:44
@Minu我注意到你的label.text語句中有name.text。它不應該是nameLabel.text嗎? – Jamie 2012-07-18 06:04:35
https://github.com/AliSoftware/OHAttributedLabel/ – waheeda 2012-07-18 05:52:18