iOS主页按钮警告,是否可能? [英] iOS home button warning, is it possible?

查看:92
本文介绍了iOS主页按钮警告,是否可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不认为这可以做到,但我的老板还是希望我提供一个链接。他想要的是在用户按下主页按钮时添加你确定要退出吗?警告,如果用户说不,则应用程序不会变为非活动状态。
它无法完成,可以吗?

I really don't think this can be done, but still my boss wants me to provide a link where it says so. What he wants is to add an 'are you sure you want to exit?' warning when the user presses the home button, and if the user says 'no' the app won't go inactive. It can't be done, can it?

推荐答案

不,你不能这样做 - 应用程序没有在这说。问问你的老板他是否见过一个可以做到这一点的iOS应用程序的例子。没有...我打赌不会。

No, you cannot do this - the application has no say in this. Ask your boss whether he has ever seen a single example of an iOS application that would do this. There isn't ... not one I would bet.

应用程序可以继续在后台执行某些功能 - 流媒体音乐,例如获取位置信息,但是没有应用程序可以阻止主页按钮。如果你能做到这一点,你就可以阻止申请关闭。

The application can continue to execute some functionality in the background - streaming music, getting location information for example, but no application can block the home button. If you could do this, you could block an application from ever closing.

A)你在技术上无法做到这一点和

A) You couldn't technically do this and

B)Apple不会允许它在App Store上发布,如果那是你正在分发的路线

B) Apple wouldn't allow it to be released on the App Store if that was the distribution route you were taking

如果你看一下这些方法创建应用程序委托时由XCode创建的存根

If you look at the methods stubs created by XCode when you create an application delegate

-(void)applicationWillResignActive:(UIApplication *)application

-(void)applicationWillTerminate:(UIApplication *)application

这些内容将填写如何评论您可以使用此方法暂停任务,禁用计时器,降低帧速率,保存数据 - nothing 关于能够延迟,查询用户是否确定消息。

That are filled will comments about how you can use this method to pause tasks, disable timers, throttle down frame rates, save data - there is nothing about being able to delay, query the user with an "Are you sure" message.

这个想法与iPhone / Pad / Pod-Touch的用户体验相反。

This whole idea is rather counter to the user-experience of the iPhone/Pad/Pod-Touch.

来自App Store指南(略有缩写):

From the App Store guidelines (slightly abbreviated):

改变设备上开关行为的应用将被
拒绝

Apps that alter the behavior of switches on the device will be rejected

这建议更改主页按钮的行为 - 因此将被拒绝。

This is a proposed change the behavior of the home button - so would be rejected.

这篇关于iOS主页按钮警告,是否可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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