退出钛金版应用程序(iOS) [英] Quit application in titanium (iOS)

查看:92
本文介绍了退出钛金版应用程序(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS相当于什么:

 win.close();
 var activity = Titanium.Android.currentActivity;
 activity.finish();

谢谢!

推荐答案

(在Titanium中)没有.此外,苹果明确禁止这样做:

There isn't (in Titanium). Further, Apple explicitly discourages this:

"iOS应用程序从不显示关闭"或退出"选项"-Apple,HIG p27 https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/MobileHIG.pdf

"An iOS app never displays a Close or Quit option" - Apple, HIG p27 https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/MobileHIG.pdf

有关于此的现有的答案:

There are existing SO answers regarding this:

在iPhone上,没有退出应用程序的概念.唯一的行动 应该导致应用退出的方法是触摸 电话,而开发人员则无法访问.

On the iPhone there is no concept of quitting an app. The only action that should cause an app to quit is touching the Home button on the phone, and that's not something developers have access to.

根据Apple的说法,您的应用不应自行终止.自从 用户未点击主页"按钮,无法返回到主页"屏幕 给用户的印象是您的应用程序崩溃了.这是 令人困惑的非标准行为,应避免.

According to Apple, your app should not terminate on its own. Since the user did not hit the Home button, any return to the Home screen gives the user the impression that your app crashed. This is confusing, non-standard behavior and should be avoided.

在此处查看现有的答案:退出iPhone应用程序的正确方法?

See existing SO answer here: Proper way to exit iPhone application?

如果毕竟,您想要一个非标准的,可能会得到您的应用拒绝的解决方案(或者如果您的应用不是发往应用商店的,则将通过企业分发方式进行私有分发)或个人使用),您可以创建模块会调用[[NSThread mainThread] exit].

If, after all this, you want a non-standard, will-probably-get-your-app-rejected solution (or if your app isn't destined for the app store, and will be distributed privately through enterprise distribution or personal use), you can create a module that calls [[NSThread mainThread] exit].

这篇关于退出钛金版应用程序(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆