Just as another alternative, check out this answer, which uses SBDimScreen()
. You could use that in conjunction with GSEventLockDevice()
.
It appears that you may now (iOS 5+) need to add an entitlement to your app to use this call successfully. If you haven't done that before, here is an example of how to do so. Obviously, in this case, the entitlement in question must be changed to com.apple.backboard.client
.
You also might see if @VictorRonin has experimented with this, as he commented on the question I linked to. I tested SBDimScreen()
on a jailbroken iOS 4.2.1 device, but my newer devices are currently unavailable to run this test. I'll try it later on iOS 5.x and post an update.
Note: the answer I linked to from Elias has a different call altogether for iOS 6.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…