关于WebView在NestedScrollView中。无法显示底层内容

时间:2016-04-22 09:35:31

标签: android webview nestedscrollview

我无法使用NestedScrollView显示webview底层内容。 底栏不是应用栏。

我很抱歉我的英语。感谢〜

依赖

compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'

enter image description here enter image description here

我的代码

<android.support.design.widget.CoordinatorLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/view_toobar" />

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

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

            <WebView
                android:id="@+id/web_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"></WebView>
        </android.support.v4.widget.NestedScrollView>
    </android.support.v4.widget.SwipeRefreshLayout>

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

1 个答案:

答案 0 :(得分:0)

您应该阅读有关Material小部件的更多信息,因为您在NewstedScrollView中使用了一些新参数。该参数在ActionBar大小的下方滚动空间。只需删除它,或更新您的代码!

app:layout_behavior="@string/appbar_scrolling_view_behavior"