A web view loads and displays rich web content, such as embedded HTML and websites, directly within your app. Mail uses a web view, for example, to show HTML content in messages.
web view可以直接在应用程序中加载并显示丰富的web内容,如嵌入式HTML和网站。例如,邮件App使用了一个web view来显示消息中的HTML内容。
Enable forward and back navigation when appropriate. Web views support forward and back navigation, but this behavior is disabled by default. If people will use your web view to visit multiple pages, enable forward and back navigation, and provide corresponding controls to initiate these features.
Avoid using a web view to build a web browser. Using a web view to let people briefly access a website without leaving the context of your app is fine, but Safari is the primary way people browse the web on iOS. Attempting to replicate the functionality of Safari in your app is unnecessary and discouraged.
适时启用前进和后退导航。Web视图支持前进和后退导航,但它默认为禁用。如果人们需要用web视图访问多个页面,则启用前后导航,并提供相应的控件来启动这些功能。
避免使用web视图来构建web浏览器。使用web视图让人们在不离开APP上下文的情况下短暂访问网站是可以的,但Safari是人们在iOS上浏览网页的主要方式。因此尝试在应用程序中复制Safari的功能是不必要也不被鼓励的。