美文网首页
UIScrollview存在,右滑手势不响应的解决

UIScrollview存在,右滑手势不响应的解决

作者: Page_online | 来源:发表于2016-08-31 10:45 被阅读0次

遇到此类情况,只需要对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>

相关文章

网友评论

      本文标题:UIScrollview存在,右滑手势不响应的解决

      本文链接:https://www.haomeiwen.com/subject/bcmqettx.html