Kju*_*uly 2 uitableview uiscrollview uicontrol ios ios8
我有一个UIScrollView实例(scrollview),以及作为子视图放在scrollview上的许多UIControl实例.一切都在iOS 8之前运行良好,但scrollview现在在iOS 8下无法滚动.
似乎UIControl实例吃触摸事件,和scrollview的delaysContentTouches被iOS 8的下断裂.
刚发现UITableView也有这个问题.
搜索了一段时间,并解决了这个问题
scrollview.panGestureRecognizer.delaysTouchesBegan = YES;
Run Code Online (Sandbox Code Playgroud)
而且还有另一种解决方法(但我没试过就试过,因为UIControl实例不起作用,请告诉我你是否有任何想法,thx):
if (floor((NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1)) {
UITapGestureRecognizer * nothingTap = [[UITapGestureRecognizer alloc] init];
[nothingTap setDelaysTouchesBegan:YES];
[scrollView addGestureRecognizer:nothingTap];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
986 次 |
| 最近记录: |