Question about having 'in app' HTML page

Discussion in 'iOS Development' started by abotsch31, Jul 3, 2009.

  1. abotsch31

    abotsch31 Banned

    Joined:
    Feb 9, 2009
    Messages:
    31
    Likes Received:
    0
    I would like to have a webpage inside my app, that doesn't require the internet, meaning I would have the webpage inside my app. I know how to display a webpage, but how would I refer to CSS and images within my app in my webview?

    thnx
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Here's what I do. In my app, or documents directory, I create a folder called HTML. I use that directory as the root directory of all my HTML/css/html images, etc, creating a directory hierarchy that mirrors how things would he set up on a server.

    I then pas an HTML document stored in that directory to my webview. From here on out, everything is the same as if you had an Internet webpage. Use . and .. to refer to the current and the previous directory.
  3. abotsch31

    abotsch31 Banned

    Joined:
    Feb 9, 2009
    Messages:
    31
    Likes Received:
    0
    Perfect! thanks a lot.

Share This Page