简体   繁体   English

我想更改UITextView的字体大小

[英]I want to change UITextView's font size

I have used UITextView in my application. 我在应用程序中使用过UITextView。 Now this might be a dumb question but how can I change the font size of text in it. 现在这可能是一个愚蠢的问题,但是如何更改其中的文本字体大小。

if any1 can help with this would be appreciated. 如果有任何可以帮助这一点,将不胜感激。

thanks 谢谢

您必须通过代码设置字体

yourtextViewObject.font = [UIFont systemFontOfSize:14];

尝试这个...

[yourtextview setFont:[UIFont boldSystemFontOfSize:13.0f]];

UITextView has a read-write font property declared: UITextView具有声明的读写font属性:

@property(nonatomic,retain) UIFont *font;

The UIFont class declares a factory method: UIFont类声明一个工厂方法:

+ (UIFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize;

So create a new UIFont instance and then call -setFont: on your UITextView with the font instance. 因此,创建一个新的UIFont实例,然后使用字体实例在UITextView上调用-setFont:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM