java - Scrolling issues having a ViewPager as the header in a ListView -
i'm trying stick viewpager (horizontal scroll) in tableview (vertical scroll). appears works unless kind of vertical scroll in viewpager happens when trying swipe. ideas on how can work properly?
you can use code (the trick disallow vertical scrolls in parent horizontal scroll detected):
viewpager.setonpagechangelistener(new onpagechangelistener() { @override public void onpageselected(int position) { } @override public void onpagescrolled(int position, float positionoffset, int positionoffsetpixels) { } @override public void onpagescrollstatechanged(int state) { if (state == viewpager.scroll_state_dragging) { viewpager.getparent().requestdisallowintercepttouchevent( true); } } });
Comments
Post a Comment