Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the uitextview font size

can any one help to change the font size in UITextView.

[textView setFont:[UIFont fontWithName:@"ArialMT" size:30]]; 

I use this one but it doesn't work.

like image 204
mychar Avatar asked Jun 29 '11 07:06

mychar


People also ask

How do I change font size in Textview in Swift?

Swift 2 & 3:import UIKit extension UITextView { func increaseFontSize () { self. font = UIFont(name: (self. font?. fontName)!, size: (self.

How do I change font size in editor?

On the menu bar, choose Tools > Options. In the options list, choose Environment > Fonts and Colors. In Show settings for list, select Text Editor. Modify the Font and Size options to change the font and text size for the editor.

How do I change the textfield font in Swift?

yes you can do it. [tFild_1 setFont:[UIFont fontWithName:@"Helvetica Neue" size:17]]; instead of "Helvetica Neue" use your font name.


2 Answers

Have you bind textView with xib or allocated textView?

If yes,

You can use following code to check whether this works

[textView setFont:[UIFont boldSystemFontOfSize:15]]; 

or

 [textView setFont:[UIFont systemFontOfSize:15]]; 
like image 78
iMOBDEV Avatar answered Sep 21 '22 14:09

iMOBDEV


Check, if "Selectable" is checked in the xib/Storyboard attribute inspector. If it's not selectable, the size wont be changed

like image 40
brainray Avatar answered Sep 22 '22 14:09

brainray