Webview inside NestedScrollView height issue

I am using support.v4.widget.NestedScrollView and I have a problem with my webview.

Here is my layout:

<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:id="@+id/barlayout">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:background="#9E9E9E"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_scrollFlags="scroll|enterAlways">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/relativeLayout"
            android:animateLayoutChanges="true">

            <!-- some views here -->

        </RelativeLayout>

    </android.support.v7.widget.Toolbar>

</android.support.design.widget.AppBarLayout>

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <WebView
        android:id="@+id/webView"
        android:layout_height="match_parent"
        android:layout_width="match_parent" />

</android.support.v4.widget.NestedScrollView>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ProgressBar
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/progressBar"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"/>

    <include
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        layout="@layout/dialog_location"
        android:id="@+id/dialog"
        android:visibility="invisible"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

</RelativeLayout>

with this layout, the webview should scroll a lot (sorry for the link, I cannot post images)

https://drive.google.com/open?id=0B7otV-_1sdEvUWRzSjlHY01fY3c

and if I change webview to wrap_content the webview is small

<WebView
        android:id="@+id/webView"
        android:layout_height="wrap_content"
        android:layout_width="match_parent" />

https://drive.google.com/open?id=0B7otV-_1sdEvbVFSRlR0a2IxeUk

+4
source share
1 answer

. google. , , - Android NestedScrollView.

:

WAI.

webview NestedScrollView, wrap_contents - . , , . NestedScrollView, -.

, - js , , , .

GL, ( , ). , . , -.

: webview NestedScrollView. - wrap_contents. - -.

+1

Source: https://habr.com/ru/post/1606870/


All Articles