我有一些UItextView IBOutlet,我需要在其中设置属性字符串。我在代码中有:
NSArray *textViews = @[self.addressTextView, self.webpageTextView, self.phoneTextView, self.phone2TextView, self.emailTextView, self.emailPkTextVIew, self.akkrTextView, self.licenseTxt];
...
for (NSInteger i = 0; i < textViews.count; i++) {
UITextView *txtView = textViews[i];
... //making attributed string
NSMutableAttributedString *fullString;
...
[fullString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Helvetica" size:15.0] range:(NSRange){0,fullString.length}];
NSLog(@"\n%@", fullString);
txtView.attributedText = fullString;
NSLog(@"\n%@ %@", txtView.attributedText);
}
所以在第一个日志中,我看到font-size是15,但在第二种情况下,有时一切都很好(对于文本视图),但有时font-size变为22或25.为什么?