Commit 358ba9d3 authored by zooble's avatar zooble Committed by GitHub

Merge pull request #186 from yushengchu/master

新增iOS picker在滚动中禁用确定按钮事件 防止选择的数据错乱
parents 9bb98a5f 3558ea34
......@@ -612,6 +612,11 @@
//按了确定按钮
-(void)cfirmAction
{
//判断当前是否在滚动选择 如果是 则禁用确定按钮
if ([self anySubViewScrolling:self.pick]) {
return ;
}
NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
if (self.backArry.count>0) {
......@@ -948,4 +953,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
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