Reputation: 3543
Is it possible to underline or embolden certain bits of text in a UITextView?
For example my Text View has headings in it, and would like those underlined...
Random Mode
In random mode, you can generate numbers...Sweepstake Mode
In sweepstake mode...
If not, what is the best way to achieve this?
Thanks
Upvotes: 2
Views: 5870
Reputation: 15115
Use should use NSAttributedString, and use controllers for drawing NSAttributesString.
Controller for NSAttributedString
Note: you can't use UITextView to display a NSAttributedString
From iOS6, UILabel now support NSAttributedString, you should use UILabel directly instead of OHAttributedLabel as it is now natively supported by the OS.
Upvotes: 2
Reputation: 2352
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!
Upvotes: 1
Reputation: 10167
I believe NSAttributedString
is what you're after, it's available in iOS 3.2 or later: look at this question
Upvotes: 2