UIScrollview存在,右滑手势不响应的解决
2016-08-31 本文已影响0人
Page_online
遇到此类情况,只需要对UIScrollview进行自定义即可
</br>
MyCustomScrollView.h文件
<pre>#import <UIKit/UIKit.h></br>
@interface MyCustomScrollView : UIScrollView</br>
@end</br>
</pre>
MyCustomScrollView.m文件
<pre>
import "MyCustomScrollView.h"</br>
@interface MyCustomScrollView ()<UIGestureRecognizerDelegate></br>
@end</br>
@implementation MyCustomScrollView</br>
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {</br>
if (gestureRecognizer.state != 0) {</br>
return YES;</br>
} else {</br>
return NO;</br>
}
}
@end</br>
</pre>