NOTE: The time when I asked this question was when Apple just released iOS 7. Apple reimplemented UITextView
with Text Kit
after iOS 7. UITextView
had some bugs that time. The issue of this question was one of them. But now it's fixed.
There is a UITextView
in my app which is configured in IB. The text view has some default text of which the font size is 60.0f
. The text view uses plain string to render text. If I change the text property of the text view programmatically when the app is running:
self.textView.text = @"some text different from default text";
the text view will change the font back to the default font.
configure font programmatically can solve this problem:
self.textView.font = [UIFont systemFontOfSize:60.0f];
This is a bug of the new UITextView
.
It's strange behaviour appears when you uncheck Selectable in IB. If you check Selectable, your Text View have got correct font. You can add textView.selectable = NO in code if you don't want to select it
Did u notice the T symbol in the right croner of font tab use this for set the font size
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With