简体   繁体   中英

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

I have an app with several SeekBars in a Scrollview. Atm almost everything is fine, but only one issue:

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. But I want the Seekbar to pass the touch to the scrollview in case the swipe goes mainly vertical. 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. 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. 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

As you see it subclasses SeekBar and overrides the OnTouch event. I helped another person subclassing the SeekBar in this thread: How to properly subclass SeekBar in MonoDroid? Just remember to have all the constructors declared, otherwise you might experience the same issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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