简体   繁体   English

UIScrollView按钮 - TouchUpInside?

[英]UIScrollView of buttons - TouchUpInside?

I have a UIScrollView filled with buttons that I created programatically. 我有一个UIScrollView填充了我以编程方式创建的按钮。 Paging is enabled and whenever users scroll through the pages rapidly they always end up accidentally clicking buttons that they didn't mean to... Should I be using TouchUpInside or is this the reason for my problem? 分页已启用,每当用户快速滚动页面时,他们总是会意外地点击他们不想要的按钮...我应该使用TouchUpInside还是这是我的问题的原因?

One thing I've noticed is that if a user presses the button then slides the scrollview doesn't move but if they slide the scroll view very quickly and let go half way through the scroll and they grabbed the scrollview on the button then the button will become "pressed" is there any way I can have the buttons not do anything if they are clicked while scrolling is in progress or is the solution simpler than that (ie just changing the touch event to a different listener) 我注意到的一件事是,如果用户按下按钮然后滑动滚动视图不会移动,但如果他们非常快速地滑动滚动视图并放开滚动的一半,他们抓住按钮上的滚动视图然后按钮将被“按下”是否有任何方法我可以让按钮在滚动正在进行时点击它们不做任何事情或者解决方案比这更简单(即只是将触摸事件更改为不同的听众)

这样做了!

setExclusiveTouch:YES

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM