How can I load a local HTML file into the UIWebView?

前端 未结 7 899
有刺的猬
有刺的猬 2020-12-09 03:17

How can we load our own html file into the UIWebView?

相关标签:
7条回答
  • 2020-12-09 03:44

    Apple's documentation suggests using loadHTMLString:baseURL::

    Use the loadHTMLString:baseURL: method to begin loading local HTML files or the loadRequest: method to begin loading web content. Use the stopLoading method to stop loading, and the loading property to find out if a web view is in the process of loading.

    The loadHTMLString:baseURL: documentation offers further reasoning:

    To help you avoid being vulnerable to security attacks, be sure to use this method to load local HTML files; don’t use loadRequest:.

    This one might help: https://stackoverflow.com/a/29741277

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