我试图加粗/斜体文本,但我使用此代码加粗我的字体,但当我整个按下粗体按钮时,UITExtView将变为粗体,但我想选择一些文本和粗体/斜体或更改它们的颜色..
textPad.font = [UIFont boldSystemFontOfSize:12];
You can't. UITextView
is all one font. Simplest way to get proper text styling is to use a UIWebView
instead.
I know this is an old thread, but this is something I just discovered myself. At least in Xcode version 4.6.3 this is possible by using an attributed textView. What's even better is that it's possible to all be done in Interface Builder!
Here are the steps:
Enjoy!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.