2010-07-10 6 views
2

목록보기를 스 와이프하는 것처럼 웹보기를 스 와이프하려고합니다 .... 왼쪽에서 오른쪽으로. 나는 here으로 표시된 길을 따라 갔다.웹 뷰를 스 와이프 할 수 없습니까?

는 또한 나는 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> 

webviews 설정 한하지만 웹보기의 onTouchEvent 여기에 작동하지 않습니다 생각합니다.

@Override 
    public boolean onTouchEvent(MotionEvent event) { 
     if (gestureDetector.onTouchEvent(event)) 
      return true; 
     else 
      return false; 
    } 

답변

1

두 개의 WebView를 LinearLayout 밖으로 이동해보십시오. ViewFlipper는 하위 뷰와 하위 뷰 사이를 전환합니다. 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"> 
    <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" /> 
</ViewFlipper> 
관련 문제