소스 검색

1.修改翻转退出灵敏度

huangxiaodong 1 년 전
부모
커밋
3da156ca97
1개의 변경된 파일12개의 추가작업 그리고 5개의 파일을 삭제
  1. 12 5
      创维盒子/双子星云手机/AppDelegate/AppDelegate.m

+ 12 - 5
创维盒子/双子星云手机/AppDelegate/AppDelegate.m

@@ -47,12 +47,19 @@
     cmManager.accelerometerUpdateInterval = 0.1;
     [cmManager startAccelerometerUpdates];
     [cmManager startDeviceMotionUpdatesToQueue:[NSOperationQueue new] withHandler:^(CMDeviceMotion * _Nullable motion, NSError * _Nullable error) {
-        CMRotationRate rotationRate = motion.rotationRate;
-        CGFloat rotationRatex = rotationRate.x;
-        CGFloat rotationRatey = rotationRate.y;
-        CGFloat rotationRatez = rotationRate.z;
+//        CMRotationRate rotationRate = motion.rotationRate;
+//        CGFloat rotationRatex = rotationRate.x;
+//        CGFloat rotationRatey = rotationRate.y;
+//        CGFloat rotationRatez = rotationRate.z;
         
-        if (rotationRatey > 7){
+        CMAcceleration accrleration = motion.gravity;
+        CGFloat rotationGravityz = accrleration.z;
+        
+        //HLog(@"rotationRatey: %f",rotationRatey)
+        //HLog(@"rotationGravityz: %f",rotationGravityz)
+        
+        //if (rotationRatey > 7){
+        if (rotationGravityz > 0.85){
             
             BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
             if (haveOpenMask){