以编程方式锁定iOS 7中的iPhone屏幕

时间:2022-10-23 21:02:23

I know that we can call GSEventLockDevice (); from the GraphicsServices.framework to lock the screen in iOS 6 and older version, as explained by H2CO3 Here. But unfortunately it's not working in iOS 7.

我知道我们可以调用GSEventLockDevice();从GraphicsServices.framework中锁定iOS 6及更早版本的屏幕,如H2CO3 Here所述。但不幸的是,它在iOS 7中无效。

My Question : How to lock the iPhone Screen programmatically in iOS 7 ?

我的问题:如何在iOS 7中以编程方式锁定iPhone屏幕?

Note : I don't want this for Appstore.

注意:我不希望这个用于Appstore。

2 个解决方案

#1


1  

Hi it's not possible in iOS7. You need special entitlement so until there will be a jailbreak you are out of luck

嗨,这在iOS7中是不可能的。你需要特殊的权利,所以在越狱之前你运气不好

#2


0  

Cant you disable all the UIGestureRecognizers for the view? I do it for buttons all the time. It is the 'enabled' property for UIButtons. Im sure you can use something like this to achieve satisfactory results. For the view I think it is userInteractionEnabled property for views. Set your view userInteractionEnabled property to NO with a UISwitch.

你不能禁用视图的所有UIGestureRecognizer吗?我一直都是按钮。它是UIButtons的“启用”属性。我相信你可以用这样的东西来达到满意的效果。对于视图,我认为它是视图的userInteractionEnabled属性。使用UISwitch将视图userInteractionEnabled属性设置为NO。

#1


1  

Hi it's not possible in iOS7. You need special entitlement so until there will be a jailbreak you are out of luck

嗨,这在iOS7中是不可能的。你需要特殊的权利,所以在越狱之前你运气不好

#2


0  

Cant you disable all the UIGestureRecognizers for the view? I do it for buttons all the time. It is the 'enabled' property for UIButtons. Im sure you can use something like this to achieve satisfactory results. For the view I think it is userInteractionEnabled property for views. Set your view userInteractionEnabled property to NO with a UISwitch.

你不能禁用视图的所有UIGestureRecognizer吗?我一直都是按钮。它是UIButtons的“启用”属性。我相信你可以用这样的东西来达到满意的效果。对于视图,我认为它是视图的userInteractionEnabled属性。使用UISwitch将视图userInteractionEnabled属性设置为NO。