Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextView Font size class not change

I try to set font size class of UITextView in storyboard, but it always shows system font (default font, size and color). It shows the correct font if I don't set font size class.

Here's a screenshot:

Anybody know how to fix this?

like image 496
zixsma Avatar asked Mar 20 '15 10:03

zixsma


2 Answers

It is matter of 'selectable' property of UITextView.

Check the selectable property of UITextView in Storyboard Editor to set it YES.

and later in viewWillAppear set this property to NO.

textview.text = @"some text";
textview.selectable = NO;
like image 141
Bista Avatar answered Nov 15 '22 03:11

Bista


Try this code

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

Instead of system font you can use your font.

like image 30
vishnu Avatar answered Nov 15 '22 03:11

vishnu