I have a UITextView in which I'm trying to display some attributed text which comes in the form of HTML. It uses things like inline bolding and italicizing. The client now wants the font on this to change. However, whenever I change the font, it seems to disregard any of the HTML formatting. Is there any way to change the font while retaining the other formatting attributes, like bolding an italicizing?
相关问题
- Get the NSRange for the visible text after scroll
- @objc protocol crashes the swift compiler
- Getting UITableViewCell from its superview iOS 7 i
- Access paging in iOS - previous and next : retriev
- Install Ad Hoc distributed app on iOS via USB, usi
相关文章
- didBeginContact:(SKPhysicsContact *)contact not in
- ios7 new pan gesture to go back in navigation stac
- IOS UICollectionview Dynamically change Cell's
- How to check if UILabel has attributedText or norm
- PhoneGap iOS 7 and localStorage
- Add UITextField to title view of navigation item
- UITextView doesn't update its contentSize
- iOS7 crashing - [__NSPlaceholderDictionary initWit
For an objective-c approach, I used
NSMutableString
and-setAttributes:
The way I was able to get it to work was to prepend my string with
<span style=\"font-family: Avenir; font-size: 12\">%@</span>