Commit 3558ea34 authored by sandsyu's avatar sandsyu

新增iOS picker在滚动中禁用确定按钮事件 防止选择的数据错乱

parent 4ae2080e
...@@ -603,6 +603,11 @@ ...@@ -603,6 +603,11 @@
//按了确定按钮 //按了确定按钮
-(void)cfirmAction -(void)cfirmAction
{ {
//判断当前是否在滚动选择 如果是 则禁用确定按钮
if ([self anySubViewScrolling:self.pick]) {
return ;
}
NSMutableDictionary *dic=[[NSMutableDictionary alloc]init]; NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
if (self.backArry.count>0) { if (self.backArry.count>0) {
...@@ -939,4 +944,18 @@ ...@@ -939,4 +944,18 @@
} }
- (BOOL)anySubViewScrolling:(UIView *)view{
if ([view isKindOfClass:[UIScrollView class]]) {
UIScrollView *scrollView = (UIScrollView *)view;
if (scrollView.dragging || scrollView.decelerating) {
return YES;
}
}
for (UIView *theSubView in view.subviews) {
if ([self anySubViewScrolling:theSubView]) {
return YES;
}
}
return NO;
}
@end @end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment