Reputation: 557
I'm developing an email app on iOS. I want to create a view that can display email. My problem is that an email body may be plain text or HTML(sometimes with CSS), so I can't find a proper UI component for such content. I tried UIWebView
, but when the content is plain text, the line breaks are ignored!
How about convert the plain text to HTML? Or just use UITextView to display content which is plain text? So, do you have any suggestions?
Update:
To addition, many HTML contents contain images most of which are just urls. If I use a text based view how can I display the images? Is there any library support such features?
Upvotes: 0
Views: 457
Reputation: 38249
Use third party textView - A rich text view for iOS with basic HTML rendering. follow bctextview link.
Upvotes: 1
Reputation: 9975
You should use UIWebView and convert the linebreaks to br tags, like this:
HtmlText = [dataString stringByReplacingOccurrencesOfString:@"\n" withString:@"<br/>"];
Upvotes: 1