Is there anyway the display of HTML content in text form?

I tried the following from the iphone cookie book. I displayed HTML content through access to a private UITextview API, e.g.

 @interface UITextView (extended)
 - (void)setContentToHTMLString:(NSString *) contentText;
 @end

he works fine . but Apple will not allow access to private API.any solution packages?

+3
source share
4 answers

Do you want to display actual HTML elements or just a line taken from the Internet? For the latter, you must do the following:

NSURL *stringURL = [NSURL URLWithString:@"http://yoursite.com/page.html"];
NSString *responseString = [NSString stringWithContentsOfURL:stringURL encoding: NSUTF8StringEncoding error:nil];
myTextView.text = responseString;
+3
source

You can try using the Three20 library, which includes a stylized text label:

http://github.com/facebook/three20/

TTStyledTextLabel Three20 "" TTStyledText. TTStyledText textFromXHTML: , NSString HTML- , . , , , .

, !

+1

HTML, UIWebView.

0

Source: https://habr.com/ru/post/1727197/


All Articles