2013-10-05 28 views
0

這是什麼原因,爲什麼這個代碼不能在IOS7中工作?我試圖設置顏色,但顏色不會改變,它使黑色:NSAttributedString不工作IOS7中的UITextVIew

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

UITextView *textView = .... 

textView.attributedText = subString; 

回答

1

使用這個我相信它的作品,因爲我已經測試

NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, nil]; 
    NSAttributedString *subString = [[NSAttributedString alloc] initWithString:@"abc" attributes:attributes]; 
相關問題