1

I have some UItextView IBOutlet, I need set attributed string in them. In code I have:

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);
}

So in first log I see that font-size is 15, but in second case sometimes all good (for text view), but sometimes font-size become 22 or 25. Why?

enter image description here

Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
user2213271
  • 421
  • 7
  • 16

0 Answers0