I have a parent which is ScrollView, which holds a HorizontalScrollView as one of it\'s child views. All works perfectly, but when someone is triggering vertical scroll, the
just try this
HorizontalScrollView hv = (HorizontalScrollView)findViewById(R.id.myHsView); // your HorizontalScrollView inside scrollview
hv.setOnTouchListener(new ListView.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
// Disallow ScrollView to intercept touch events.
v.getParent().requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
// Allow ScrollView to intercept touch events.
v.getParent().requestDisallowInterceptTouchEvent(false);
break;
}
// Handle HorizontalScrollView touch events.
v.onTouchEvent(event);
return true;
}
});