我正在尝试像列表视图滑动一样从左到右滑动 Web 视图。我已经按照此处显示的方式进行了操作。
我也设置webviews
了viewflipper
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/flipper" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview1" android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview2" android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
但我认为onTouchEvent
webView 在这里不起作用。
@Override
public boolean onTouchEvent(MotionEvent event) {
if (gestureDetector.onTouchEvent(event))
return true;
else
return false;
}