iOS Question Local FilePath in WebView

Discussion in 'iOS Questions' started by Moosi, Mar 26, 2015.

  1. Moosi

    Moosi Member Licensed User

    Hi,
    when loading a local html into a WebView in B4A, I can use Links to Images inside the html like
    "<img src="file:///android_asset/TheFile.png" />"

    What is the equivalent path in B4i ?

    thanks a lot
    Moosi
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Moosi

    Moosi Member Licensed User

    Code:
    Dim linktoimage as String
    linktoimage = 
    File.Combine(File.DirAssets, "pic.png")
    WebView1.LoadHtml(
    "<html><head></head><body><img src=' " & linktoimage & " '></body></html>")
    Thanks Erel,
    but this code does not work here. Is this related to the debug mode, maybe?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    It should work in both modes. Make sure that the file name is lower cased.
     
  5. Moosi

    Moosi Member Licensed User

    Hi Erel,
    sorry for replying so late, had been on vacation.

    The lower case did the trick, thanks a lot!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice