私は文字列を持っています....別の色でShare Pictures
表示したい.以前は文字列のその部分の色を変更していました.しかし、次の文字列を使用して設定しているときは機能しません.他の方法これを行う?Share
NSMutableAttributedString
cell.textLabel.text
この方法では機能しません。
NSMutableAttributedString *string3 = [[NSMutableAttributedString alloc]initWithString:@"Share pictures "];
[string3 addAttribute:NSForegroundColorAttributeName value:[UIColor orangeColor] range:NSMakeRange(0, 4)];
NSString *tempStr3 = @"with your friends.";
NSString *finalString3 = [NSString stringWithFormat:@"%@%@" , string3, tempStr3];
[menuTextArray addObject:finalString3];
そしてテーブルビューのデータソースメソッドで。
cell.textLabel.text = [menuTextArray objectAtIndex:indexPath.row];