2

I am currently designing a help page for my iPhone app using interface builder. IB seems lacking in terms of designing content that is larger than one page. I may want to put an image or two in between content to make the help more visually appealing and easier to understand. Currently I have one large label that flows off the screen which doesnt scroll.

So what is the best method to achieve a half decent help page, with basic text and images and scrolling. Am I best off simply creating a web page and embedding it in the app somehow then displaying it in a web control?

Chris
  • 26,744
  • 48
  • 193
  • 345

3 Answers3

2

You should look at Facebook's Three20 library ( http://three20.info ) and its TTStyledLabel. It can handle HTML-like formatting. If you need content larger thatn one page, you should consider using UIWebView for that.

Ahmed Al Hafoudh
  • 8,281
  • 1
  • 18
  • 34
2

The UIWebView will handle HTML content given to it in a string.

If you want to load local images in the UIWebview, refer to this link:

Define path using:

NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
[webView loadHTMLString:htmlString baseURL:baseURL];

Then you can access the image using the standard

<img src="myimage.png">

This link is the original page.

Community
  • 1
  • 1
dgund
  • 3,459
  • 4
  • 39
  • 64
1

Put your text label inside a UIScrollView and set it's lineBreakMode to UILineBreakModeWordWrap:

textLabel.lineBreakMode = UILineBreakModeWordWrap;
textLabel.numberOfLines = 2;
esqew
  • 42,425
  • 27
  • 92
  • 132
  • I can't seem to get this to work. I have a Scroll View with two labels inside, one heading and one with the content set to 0 lines and word wrap... – Chris Jan 19 '12 at 22:00