iPhone应用程序应该关闭,而不是去背景 [英] iPhone Application Should Close, not go to Background

查看:112
本文介绍了iPhone应用程序应该关闭,而不是去背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,当用户点击iPhone的中央按钮时,应用程序被发送到后台,但我希望它被关闭。

I have an application wherein when the user taps iPhone's central button, the application is sent to background, but I want it to be closed.

我可以举办活动并关闭它,但可能有一些配置设置拒绝在后台运行?

I can hand event and close it, but may be there is some configuration setting to deny running in the background?

谢谢

推荐答案

如果您希望在用户按下主页按钮时终止您的应用,请将 UIApplicationExitsOnSuspend 的值设置为 YES 在您应用的 Info.plist 文件中。如果您这样做,当用户点击主页按钮时,将调用您的应用程序委托的 applicationWillTerminate:方法,然后您的应用程序将终止。

If you want your app to terminate when the user presses the home button, set the value of UIApplicationExitsOnSuspend to YES in your app's Info.plist file. If you do this, when the user taps the home button the applicationWillTerminate: method of your app delegate will be called and then your application will terminate.

这篇关于iPhone应用程序应该关闭,而不是去背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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