0

このコードが IOS7 で機能しない理由は何ですか? 色を設定しようとしていますが、色は変わらず、黒のままです:

NSDictionary *attributes = [NSDictionary dictionaryWithObject:[UIColor redColor] forKey:NSForegroundColorAttributeName];
NSAttributedString *subString = [[NSAttributedString alloc] initWithString:@"abc" attributes:attributes];

UITextView *textView = ....

textView.attributedText = subString;
4

1 に答える 1

0

これを使用してください。テストしたので、動作すると確信しています

    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, nil];
    NSAttributedString *subString = [[NSAttributedString alloc] initWithString:@"abc" attributes:attributes];
于 2013-10-07T07:21:11.503 に答える