Displaying an html document?

Discussion in 'iOS Development' started by gojohnnyboi, Jun 17, 2008.

  1. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Ok, so what's the easiest way to display an html document in an application.

    I found that using just text views and uiscrollers looked sloppy, so...

    Thanks
    -John
  2. vieestchien

    vieestchien New Member

    Joined:
    May 7, 2008
    Messages:
    43
    Likes Received:
    1
    Well, then how do you want it to look like? I find UITextView good enough.
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    I want it to be more easily customizable...does it matter?

    I now know it requires using a UIWebView, but I dont know how to get it to load a html docuemnt from INSIDE the app
  4. optimo

    optimo New Member

    Joined:
    Sep 28, 2007
    Messages:
    535
    Likes Received:
    17
    all been covered before on idevdocs
    you can have it load an html file you have, or you can put the html code right into a string method
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    getting a local html document wasn't covered on idevdocs, but i figured it out with some research.


    im not sure if this is the exact code, but i used something similar to this( i just woke up im lazy):

    Code:
    NSURLRequest* infoHTML = [ [ NSURLRequest alloc ] initWithURL: [ NSURL fileURLWithPath: [ [ NSBundle mainBundle ] pathForResource:@"Info" ofType:@"html" ] ] ];
    that seems to work nicely when i do this for my webview

    Code:
    [ infoWebView loadRequest: infoHTML ];

    =)

Share This Page