我可以像这样在我的应用程序中检测锁定屏幕模式:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UIApplicationState state = [application applicationState];
switch (state) {
case UIApplicationStateInactive:
NSLog(@"LockScreen");
[self.viewController addGestureRecognizersToView:self.viewController.view];
break;
case UIApplicationStateBackground:
NSLog(@"Background");
break;
default:
break;
}
}
我想继续识别手势(点击,长按...),但不需要滑动解锁。可能吗?哪个选项来控制它?