何时在 iPhone 应用程序中使用 UIWebView 与 Safari?
在 iPhone 应用程序中显示 Web 内容时,我们通常可以选择在 UIWebView 中显示该内容,或者弹出打开 Safari 实例。
我通常发现,对于相关内容,使用 UIWebView 在“应用内”显示内容的体验更清晰(可能在模态视图或导航控制器中),尽管这样做需要更多工作。
对于可能不相关的内容,我通常会使用 Safari。
选择一种方法而不是另一种方法是否有任何既定的推理依据?
编辑:除了技术之外,您对用户体验的推理是什么?
When displaying web content within an iPhone App, we can generally choose between displaying that content within a UIWebView, or popping open an instance of Safari.
I've generally found that for related content, the experience of displaying the content "in-app" by using a UIWebView is cleaner (maybe in a modal view or navigationcontroller), though it's a bit more work to do so.
For possibly unrelated content, I'll generally go for Safari.
Is there any established line of reasoning for picking one method over the other?
EDIT: Along with the technical, what's your reasoning with respect to user experience?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
上次我读到,Safari 执行 JS 的速度比嵌入式 UIWebView 快得多。 UIWebView 用于用户生成的应用程序,不会预编译 JS 以提高速度。
看起来像这样缺陷iOS 5 可能会消失。
Last I read, Safari will execute JS much faster than an embedded UIWebView. The UIWebView, as it is used in user-generated apps, will not precompile the JS for improved speed.
It looks like this deficiency may go away iOS 5.
关于用户体验,我认为这取决于网页内容在用户工作流程中何时向用户显示。另外,完成的频率和频率是多少?它有多分散注意力?这些事情很重要,因为您希望让用户在您的应用程序中停留最长的时间(用户很可能不会回来)。如果用户必须多次离开您的应用程序并转到 Safari,这会让用户感到沮丧。在短时间内返回您的申请。此外,如果您已经指定您的应用程序在发送到后台时将被终止,那么您不应该启动 Safari。
例如,当您创建“设置”页面时,同样的因素也适用。引用 HIG 的话,
HTH,
阿克谢
With respect to the UX, I think it depends on when the web content is displayed to the user in the user's workflow. Also, how frequently it is done & how distracting it can be? These things matter because you want to keep the user inside your app for the maximum amount of time (there is a good chance that the user won't come back). It is frustrating for the user if she has to leave your app to go to Safari multiple times & return back to your application within a short span of time. Moreover, if by any chance you have specified that your app be terminated if it is sent to the background, then you should not be launching Safari.
For example, the same factors hold when you create you Settings page. To quote from the HIG,
HTH,
Akshay