ios 暂时锁定或禁用iphone home键

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4190169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 18:05:47  来源:igfitidea点击:

Temporarily Lock or Disable iphone home button

iphoneiphone-sdk-3.0iosios4

提问by PlanetUnknown

I know the iphone home button is extremely crucial for the functioning of the iphone.
However I have an idea for which I need the application running and the home button to be disabled. I tried googling, but haven't been able to find a solution.

我知道 iPhone 的主页按钮对 iPhone 的功能至关重要。
但是我有一个想法,我需要运行应用程序并禁用主页按钮。我尝试谷歌搜索,但一直无法找到解决方案。

Temporary or timed locking (Lock for 5/10 mins.) would also do.

临时或定时锁定(锁定 5/10 分钟)也可以。

The app. should work on non-jailbroken phones, hence going around apple won't work.

应用程序。应该在未越狱的手机上工作,因此绕过苹果是行不通的。

Appreciate any ideas.

欣赏任何想法。

回答by Fattie

Note, from 2014 onwards: just to be clear,

请注意,从 2014 年开始:为了清楚起见,

this is now built in to iOS...

这现在内置于iOS...

Click to accessibility, click "guided access".

点击辅助功能,点击“指导访问”

Conrats for "inventing" it, PlanetUnknonw! :-)

恭喜“发明”它,PlanetUnknonw!:-)

The answer below is only of historic value...

以下答案仅具有历史价值...



For the record, it's sillythat people are saying "Why would you want to do this?"

为了记录,人们说“你为什么要这样做?”是愚蠢的

it's a great idea for example for APPS FOR SMALL CHILDREN(which is indeed a very large marketon the iPhone).

这是一个好主意,例如适用于小孩子的应用程序(这在 iPhone 上确实是一个非常大的市场)。

If you've ever marketed an app for small children, you'll know that instantly parents write in abusing you because you "did not stop that stupid home button working, so the child just turns off the game and makes phone calls"

如果您曾经为小孩推销过一款应用程序,您就会知道,父母会立即写信辱骂您,因为您“没有停止那个愚蠢的主页按钮的工作,所以孩子只是关闭游戏并拨打电话”

To which you have to reply that it's of course not possible because of the way the iPhone works.

您必须回答说,由于 iPhone 的工作方式,这当然是不可能的。

So yes it's a good question. As far as I know, Planet, it is not possible.

所以是的,这是一个很好的问题。据我所知,行星,这是不可能的。

Apple should add a "kids mode" where parents can lock the fone on TO one particular app for awhile. (Perhaps you would have to long-press or something the home button to unlock it.)

Apple 应该添加一个“儿童模式”,让父母可以将 fone 锁定在一个特定的应用程序上一段时间。(也许您必须长按或按下主页按钮才能将其解锁。)

回答by DJ Bouche

UPDATE

更新

*iOS 6 reportedly has a "Single App Mode" - Check out vpdn's answer below https://stackoverflow.com/a/10503799/333259

*据报道,iOS 6 具有“单一应用程序模式”-在https://stackoverflow.com/a/10503799/333259下面查看 vpdn 的答案

This is against the iOS interface guidelines, and apps have been rejected for "overriding" or restricting behaviour of hardware buttons/switches.

这违反了 iOS 界面指南,应用程序因“覆盖”或限制硬件按钮/开关的行为而被拒绝。

I suggest you have a read of the App Store Review Guidelinefor iOS apps for a good overview of what you shouldn't be doing.

我建议您阅读iOS 应用程序的App Store 审核指南,以便对您不应该做的事情有一个很好的概述。

Particularly:

特别:

10.5

Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected

10.5

改变标准开关功能的应用程序,例如音量增大/减小和响铃/静音开关,将被拒绝

Pretty sure that the Home button is included in that.

很确定主页按钮包含在其中。

I'm not sure what your "idea" is here, but I would suggest you look into other things such as backgrounding. There is a feature that allows you to finish executing tasks in the background, even if the user presses the home button, and optionally display a notification after certain time (before the task "expires"). I imagine that this might offer a more appropriate solution (again dependent on what your idea actually is).

我不确定您在这里的“想法”是什么,但我建议您查看其他内容,例如backgrounding。有一项功能允许您在后台完成执行任务,即使用户按下主页按钮,并可选择在特定时间后(在任务“到期”之前)显示通知。我想这可能会提供更合适的解决方案(再次取决于您的想法实际上是什么)。

回答by DJ Bouche

In iOS6 (to be released), there's a feature called "Guided Access", which will allow device owners to lock users (like toddlers and school kids) into an app.

在 iOS6(即将发布)中,有一项名为“引导式访问”的功能,它允许设备所有者将用户(如幼儿和学童)锁定到应用程序中。

Update: Before the shitstorm about NDA content starts, here's where I got the info from: http://www.theverge.com/2012/6/11/3078350/apple-ios-6-guided-access-parental-control

更新:在关于 NDA 内容的混乱开始之前,我从这里获取信息:http: //www.theverge.com/2012/6/11/3078350/apple-ios-6-guided-access-parental-control

回答by Catman232

You can't unless you want to run it on jail broken devices.

除非你想在越狱的设备上运行它,否则你不能。

回答by LiquidSoapDispenser

Apple currently will not allow any software to disable or change ANY button functionality for iPhone, iPad, and iPod touch, so the only software solution is to jailbreak the device, so you're not forced to live by Apple's rules.

Apple 目前不允许任何软件禁用或更改 iPhone、iPad 和 iPod touch 的任何按钮功能,因此唯一的软件解决方案是越狱设备,这样您就不会被迫遵守 Apple 的规则。

However, PaperclipRobot.com is about to release a home button cover specifically targeted to keeping young kids from pressing the home button. Not the exact solution to your problem as stated, but I figured it added to the discussion.

然而,PaperclipRobot.com 即将发布一个主页按钮保护套,专门用于防止年幼的孩子按下主页按钮。不是您所说的问题的确切解决方案,但我认为它已添加到讨论中。

回答by njalk

Unsure if you are looking for a way to do it in code in an app or if you're thinking of locking it in general.

不确定您是否正在寻找一种在应用程序的代码中执行此操作的方法,或者您是否正在考虑将其锁定。

Anyways, if you're looking for a way to do it in general, here's a guide for it

无论如何,如果您正在寻找一种一般的方法,这里有一个指南

http://igrudge.net/how-to-disable-the-home-button-on-ios-devices-iphoneipad/

http://igrudge.net/how-to-disable-the-home-button-on-ios-devices-iphoneipad/

回答by Danny Staple

If you are looking to temporarily disable the home button to keep a child in a particular app, the tip for a make magazine article is to use a bulldog clip to cover the home button cheaper, and more reusable than a bubcap, temporary and effective.

如果您希望暂时禁用主页按钮以将孩子留在特定应用程序中,那么制作杂志文章的提示是使用斗牛犬夹来覆盖主页按钮,比 bubcap 更便宜,更可重复使用,临时且有效。

Source: http://blog.makezine.com/2011/03/01/ipad-home-button-child-lock/

来源:http: //blog.makezine.com/2011/03/01/ipad-home-button-child-lock/