原文鏈接:http://www.linuxidc.com/Linux/2014-03/98847.htm
--------------------------------------------------------------
在做更新界面的時候,同時使用了scrollview和webview兩個組件。在模擬器中測試的時候沒有問題,但是在手機上測試的時候,發現滾動不了,于是乎查資料發現是這兩個組件沖突所致。
解決方式如下:
wView.setOnTouchListener(new OnTouchListener() {
? ? ? @Override
? ? ? public boolean onTouch(View v, MotionEvent event) {
? ? ? ? // TODO Auto-generated method stub
? ? ? ? if (event.getAction() == MotionEvent.ACTION_UP)?
? ? ? ? ? scrollView.requestDisallowInterceptTouchEvent(false);?
? ? ? ? ? ? ? else??
? ? ? ? ? ? ? scrollView.requestDisallowInterceptTouchEvent(true);
? ? ? ? ? ? ? return false;?
? ? ? }
? ? ? });