Browse Source

1.修改iOS Apex Mobile KPI在圆外Touch饼状图仍然响应。

Pen Li 8 years ago
parent
commit
6372ec9ca9

+ 5 - 1
Apex Mobile/Apex Mobile/KPICell.m

@@ -430,16 +430,20 @@
         if (distance > radius) {
             ((UICollectionView *)self.superview).scrollEnabled = YES;
             ((UITableView *)self.superview.superview.superview.superview).scrollEnabled = YES;
+            NSLog(@"View Touch Scroll YES");
+            return nil;
         } else {
             ((UICollectionView *)self.superview).scrollEnabled = NO;
             ((UITableView *)self.superview.superview.superview.superview).scrollEnabled = NO;
+            NSLog(@"View Touch Scroll NO");
         }
     } else {
         ((UICollectionView *)self.superview).scrollEnabled = YES;
         ((UITableView *)self.superview.superview.superview.superview).scrollEnabled = YES;
+//        NSLog(@"Nil Touch Scroll YES");
     }
     
-    NSLog(@"Touch Scroll %@",@(((UICollectionView *)self.superview).scrollEnabled));
+//    NSLog(@"Touch Scroll %@",@(((UICollectionView *)self.superview).scrollEnabled));
     
     return view;
 }

+ 8 - 1
Apex Mobile/Apex Mobile/PieChart/XYRotatedView.m

@@ -351,8 +351,15 @@
         _mRelativeTheta   = [self thetaForTouch:touch onView:self];
 //        int tapAreaIndex = [self touchIndex];
     
+    CGPoint touchPoint = [touch locationInView:self.pieChart];
+    CGFloat len = sqrt(pow(touchPoint.x - self.pieChart.center.x, 2) + pow(touchPoint.y - self.pieChart.center.y, 2));
+    if (len > self.pieChart.pieRadius) {
+        self.touch_index = -1;
+    } else {
+        self.touch_index =[self touchIndex];
+    }
+    
     
-    self.touch_index =[self touchIndex];
     
    
 //    NSLog(@"touch move %f index %d",_mRelativeTheta,tapAreaIndex);