UIWebView baseURL and absolute path

后端 未结 2 1796
轻奢々
轻奢々 2021-01-12 21:17

I have an HTML page that is constructed like this:


  
    
  
  &l         


        
相关标签:
2条回答
  • 2021-01-12 21:43

    Removing the slash was the only solution

    0 讨论(0)
  • 2021-01-12 21:54

    Generate your path and base url the following way:

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

    A great blog on the subject:

    http://iphoneincubator.com/blog/windows-views/uiwebview-revisited

    A SO QA on the subject

    UIWebView and local css file

    0 讨论(0)
提交回复
热议问题