Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to present long text in iOS?

I am working on a small app, and I would like to bundle some short text descriptions, maybe with some images, in the help section. What control should I use to place these content? UILabel doesn't look too smart because it doesn't wrap text.

like image 336
Haoest Avatar asked Jun 21 '11 05:06

Haoest


1 Answers

I used a UIWebView for this sort of thing.

I write out the help in HTML, including images if needs be, and then load it into a UIWebView. It is pretty flexible in terms of layout and fairly trivial to implement:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Instructions" 
                                                                                                         ofType:@"html"]
                                                             isDirectory:NO]]];         

Just add the file Instructions.html to your app and you're good to go.

like image 133
PengOne Avatar answered Sep 28 '22 20:09

PengOne