UIButton不允许UIScrollView滚动 [英] UIButton Doesn't allow UIScrollView to scroll

查看:127
本文介绍了UIButton不允许UIScrollView滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 UIScrollView 中有很多 UIButtons 。那些 UIButtons Touch Down Repeat 中附加了操作。我的问题是当我触摸按钮然后滚动时我的滚动视图不滚动,但如果我触摸按钮外它可以正常工作。

I have many UIButtons within a UIScrollView. Those UIButtons have actions attached to them in Touch Down Repeat. My problem is my scroll view doesn't scroll when I touch a button then scroll, but it works fine if I touch outside of the button.

即使按下按钮,如何让我的滚动视图滚动?

How can I allow my scroll view to scroll even though a button is pressed?

推荐答案

只要在Interface Builder中设置了可取消内容触摸,它就可以正常工作。您也可以在代码中设置它:

As long as you have the Cancellable Content Touches in Interface Builder set it should work. You can also set it in code:

scrollView.canCancelContentTouches = YES;

这篇关于UIButton不允许UIScrollView滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆