try this
将禁用滚动,只要你想(垂直/水平)。 或者你可以试试这个:
实现setOnTouchListener在父滚动视图和孩子realviewswitcher这样的:
parentScrollView= (ScrollView) findViewById(R.id.parentScrollview);
parentScrollView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
//Log.v(TAG,"PARENT TOUCH");
findViewById(R.id.childScrollView).getParent().requestDisallowInterceptTouchEvent(false);
return false;
}
});
childScrollView= (ScrollView) findViewById(R.id.childScrollView);
childScrollView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
//Log.v(TAG,"PARENT TOUCH");
findViewById(R.id.childScrollView).getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});
它不工作。我没有两个滚动视图。我在Scrollview中有一个viewswitcher。 – Deepu 2013-04-08 09:24:20
似乎完美的工作。应该得到绿色的复选标记 – 2014-08-19 21:08:47