简体   繁体   English

垂直滚动视图中有多个水平搜索栏,尝试滚动以修改搜索栏值

[英]Multiple horizontal seekbars in vertical scrollview, attempt to scroll modifies seekbar value

I have an app with several SeekBars in a Scrollview. 我有一个在Scrollview中带有多个SeekBars的应用程序。 Atm almost everything is fine, but only one issue: Atm几乎一切都很好,但是只有一个问题:

If I swipe over the screen to scroll up or down, and the start of the swipe is on a seekbar, i modify the value of the seekbar. 如果我在屏幕上滑动以向上或向下滚动,并且滑动的开始在搜索栏上,则我将修改搜索栏的值。 The Seekbar seems to grab the Touch and doesn't release it until i stop touching. Seekbar似乎抓住了Touch,直到我停止触摸才释放它。 But I want the Seekbar to pass the touch to the scrollview in case the swipe goes mainly vertical. 但是我希望Seekbar将触摸传递给滚动视图,以防滑动主要是垂直的。 Did anyone ever realise that? 有没有人意识到? I'm completly clueless how to solve this. 我完全不知道如何解决这个问题。

Thank you for your help. 谢谢您的帮助。

Edit: 编辑:

I'm having this issue in Java too. 我在Java中也遇到这个问题。 and i really don't want to implement a seekbar from scratch. 而且我真的不想从头开始实现一个搜索栏。

I think you would need to override the seekbar onTouch event no matter what. 我认为无论如何您都将需要覆盖seekbar onTouch事件。 Doing a bit of searching lead me to this answer, which seems like the way to go for you as well: Issue using seekbar inside a scroll view 进行一些搜索后,我得到了这个答案,这似乎也适用于您: 在滚动视图中使用seekbar进行发布

As you see it subclasses SeekBar and overrides the OnTouch event. 如您所见,它是SeekBar的子类,并覆盖了OnTouch事件。 I helped another person subclassing the SeekBar in this thread: How to properly subclass SeekBar in MonoDroid? 我在此线程中帮助另一个人将SeekBar子类化: 如何在MonoDroid中正确地子类化SeekBar? Just remember to have all the constructors declared, otherwise you might experience the same issues. 只需记住声明所有构造函数,否则您可能会遇到相同的问题。

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

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