何时在 iPhone 应用程序中使用 UIWebView 与 Safari?

发布于 2024-11-30 17:52:35 字数 258 浏览 2 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

手心的海 2024-12-07 17:52:35

上次我读到,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.

爱她像谁 2024-12-07 17:52:35

关于用户体验,我认为这取决于网页内容在用户工作流程中何时向用户显示。另外,完成的频率和频率是多少?它有多分散注意力?这些事情很重要,因为您希望让用户在您的应用程序中停留最长的时间(用户很可能不会回来)。如果用户必须多次离开您的应用程序并转到 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,

Applications then have two options for presenting preferences:

Display preferences inside the application. OR

Use a Settings bundle to
manage preferences from the Settings application.

Which option you choose depends on how you expect users to interact
with them. The Settings bundle is generally the preferred mechanism
for displaying preferences. However, games and other applications that
contain configuration options or other frequently accessed preferences
might want to present them inside the application instead.

HTH,

Akshay

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文