UITextView Font size does not change

I am trying to set the font size class of the UITextView in a storyboard, but the system font is always displayed (default font, size and color). It shows the correct font if I do not set the font size class.

Here is a screenshot:

Does anyone know how to fix this?

+5
source share
2 answers

This is a matter of the โ€œselectableโ€ property of the UITextView .

Check the value of the selected UITextView property in the storyboard editor to set it to YES.

and then in viewWillAppear set this property to NO .

 textview.text = @"some text"; textview.selectable = NO; 
+6
source

Try this code

 -(void)viewWillAppear:(BOOL)animated { _linkTextView.editable = YES; _linkTextView.font = [UIFont systemFontOfSize:18.0f]; _linkTextView.editable = NO; } 

Instead of a system font, you can use your own font.

+2
source

Source: https://habr.com/ru/post/1215743/


All Articles