含有按钮的ScrollView在iOS8中无法滚动的解决办法 | ScrollView with UIControl/UIButton subviews not scrollable under iOS 8
2014-10-19 12:11
633 查看
转自:http://zcw.me/blogwp/%E5%90%AB%E6%9C%89%E6%8C%89%E9%92%AE%E7%9A%84scrollview%E5%9C%A8ios8%E4%B8%AD%E6%97%A0%E6%B3%95%E6%BB%9A%E5%8A%A8%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95-scrollview-with-uicontroluibutton-subv/
这样设置就可以了:
Searched for a while and got this issue fixed by
I found that in iOS 8, the UIScrollView's underlying UIPanGestureRecognizer is not respecting the UIScrollView's delaysContentTouches property. I consider this an iOS 8 bug. Here's my workaround:
And there's also another workaround (but I tried without lucky, cause UIControl instances not works then, let me know if u've any idea about it, thx):
这样设置就可以了:
Searched for a while and got this issue fixed by
scrollview.panGestureRecognizer.delaysTouchesBegan = YES; ————————————————————— 另外:
I found that in iOS 8, the UIScrollView's underlying UIPanGestureRecognizer is not respecting the UIScrollView's delaysContentTouches property. I consider this an iOS 8 bug. Here's my workaround:
[code]theScrollView.panGestureRecognizer.delaysTouchesBegan = theScrollView.delaysContentTouches[/code]
And there's also another workaround (but I tried without lucky, cause UIControl instances not works then, let me know if u've any idea about it, thx):
[code]if (floor((NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1)) { UITapGestureRecognizer * nothingTap = [[UITapGestureRecognizer alloc] init]; [nothingTap setDelaysTouchesBegan:YES]; [scrollView addGestureRecognizer:nothingTap]; } 再另外,还可以写一个继承UIScrollView的子类: 见http://stackoverflow.com/questions/25800325/ios-8-buttons-in-horizontal-scroll-view-intercepting-pan-event-scroll-does-n[/code]
相关文章推荐
- 【iOS开发-53】案例学习:scrollView的核心用法以及无法滚动的解决办法
- UIScrollView无法滚动的解决办法
- IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
- 在含有WebView、ScrollView和TableView等的Controller中侧滑返回无效,解决侧滑返回,又遇到假死问题的解决办法
- UIScrollView无法滚动可能的原因及解决办法分析
- iOS 解决数据过少UICollectionView无法滚动的方法
- 『IOS』UIScrollView无法响应touch事件的解决办法
- [IOS开发记录]Whose view is not in the window hierarchy 错误的解决办法
- UICollectionView recieved layout attributes for a cell with an index path that does not exist 解决办法
- ios Embedded binary is not signed with the same certificate as the parent app. 解决办法
- [iOS] UIButton 不响应或延迟响应 UIControlEventTouchDown 事件的解决办法
- 解决iOS8.0以上系统下无法通过代码创建被删除过的同名相册 ( iOS 8 Photos framework: Create a albums with iOS8 )
- IOS loaded the "XXXXXView" nib but the view outlet was not set.' 解决办法
- Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier解决办法
- android scrollView 内部子布局无法充满屏幕- LinearLayout not expanding inside a ScrollView
- UIScrollView无法滚动可能的原因及解决办法分析
- iOS 如何解决'could not dequeue a view of kind: UICollectionElementKindCell with identifier cell
- ScrollView+ListView滚动冲突,没有滑动效果 解决办法
- iOS 当使用FD_FullscreenPopViewController的时候遇到scrollView右滑手势无法使用的解决