Horizontalscrollview fillviewport disable scrolling?

I have this layout and it is scaled weirdly (possibly due to invalid layout) if I don't use fillviewport = true in my HorizontalScrollView.

Everything works peachy (except for odd scaling) when fillviewport = false, but when fillviewport = true, scaling is perfect, but scrolling does not happen.

This is the layout (Note: I know that you should not have the webview scrollable. But there is no smooth transition in the webview or the setscroller method, so ... bleh.)

<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webContainer"
    android:layout_below="@+id/titlebar"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">
    <WebView 
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/webZ"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    />
</HorizontalScrollView>

Android setting: fillViewport = "true" usually doesn’t disable scrolling in the view, right?

, scrollview , ? , , webview, .

logcat, , . ( fillviewport false.)

+5
2

, "fill_parent", " , ". wrap_content .

+4

ScrollView, WebView: . fill_parent wrap_content .

Romain Guy , TextView, WebView.

:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:fillViewport="true">
    <LinearLayout
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:orientation="vertical">
        <WebView android:id="@+id/webview"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:layout_weight="1.0">
        </WebView>
        <Button 
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:text="Click">
        </Button>
    </LinearLayout>     
</ScrollView>

-, :

small_data_not_ok1

WebView , , :

small_data_not_ok2

, . , , DPAD ...

, : LinearLayout, WebView

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:fillViewport="true">
    <LinearLayout
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:orientation="vertical">
        <LinearLayout android:id="@+id/linearlayout"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:layout_weight="1.0"
            android:orientation="vertical">
            <WebView android:id="@+id/webview"
                android:layout_width="fill_parent" android:layout_height="wrap_content">
            </WebView>
        </LinearLayout>
        <Button 
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:text="Click">
        </Button>
    </LinearLayout>     
</ScrollView>

:

ok1ok2

+2

All Articles