0

私はこのレイアウトを持っています:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/back"
>

<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>

<ImageView android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_gravity="center_horizontal"/>


<WebView 
    android:id="@+id/htmlView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

/>

</ScrollView>

Webview は html 形式のテキストを表示するだけで、特別な機能は必要ありません。問題は、スクロール可能なレイアウトが得られないことですが、次のようなものです:


textview (大きい、レイアウトの約 30%、スクロール不可)


画像 (大きい、約 50% スクロール不可)


小さなスクロール可能なウェブビュー


問題はどこですか?

4

1 に答える 1

1

これはあなたを助けるかもしれません......

parentScrollView.setOnTouchListener(new View.OnTouchListener() {

                    public boolean onTouch(View v, MotionEvent event) {
                        Log.v(TAG,"PARENT TOUCH");
                        findViewById(R.id.webView).getParent().requestDisallowInterceptTouchEvent(false);
                        return false;
                    }
                });
                webView.setOnTouchListener(new View.OnTouchListener() {

                    public boolean onTouch(View v, MotionEvent event)
                    {
                        Log.v(TAG,"CHILD TOUCH");
                         //  Disallow the touch request for parent scroll on touch of child view
                        v.getParent().requestDisallowInterceptTouchEvent(true);
                        return false;
                    }
                });
于 2012-09-06T16:03:12.660 に答える