我正面临着Viewpager的问题。如何在刷子视图时停止滑动查看寻呼机内部适配器。我附加了有关我的屏幕的图像。
当我点击Horizontal ListView时整个Viewpager正在滑动。我希望只有在未触及Horizontal Listview时才能滑动视图寻呼机。谢谢
答案 0 :(得分:0)
//here this code is writing for disable scroll of parent item so same thing you
can do it you can disable it from your child here
vp.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
v.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});
vp.setOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageSelected(int arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
// TODO Auto-generated method stub
vp.getParent().requestDisallowInterceptTouchEvent(true);
}
@Override
public void onPageScrollStateChanged(int arg0) {
// TODO Auto-generated method stub
}
});