Gallery 内的 ScrollView 内的按钮不响应单击
我有一个以 ScrollViews 作为子项目的画廊。滚动视图可以在滚动区域内包含文本、图像和按钮。我需要确保触摸事件按预期正确处理。
我在这里找到了一个很好的解决方案: ScrollView inside Gallery,两者独立滚动
不幸的是,这个解决方案对按钮没有帮助。有时,点击按钮会导致图库控件滚动到相邻项目。
当按钮位于滚动视图内部且滚动视图是图库控件中的项目时,如何防止 ScrollView 和 Gallery 滚动,然后用户点击按钮?
有人可以为我提供识别“点击”手势的解决方案吗?
I have a Gallery with ScrollViews as child items. Scroll view can contain text, images and button inside of the scroll area. I need to make sure that the touch events are handled correctly and as expected.
I’ve found solution a good here: ScrollView inside Gallery, both scrolling independently
Unfortunately, this solution doesn't help with buttons. Tapping on the button, sometimes, causes gallery control to scroll to the neighbor item.
How to prevent ScrollView and Gallery from scrolling then user is tapping on the button when button is inside of the scroll view and scroll view is item in the gallery control?
Can someone provide me with a solution of recognizing “click” gesture?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我曾经遇到过类似的情况 - 我通过在 XML 中添加 onClick 来修复它:
然后在您的代码中添加:
I had something like this once - I fixed it by adding an onClick in the XML:
then in your code: