支持Android设计库CoordinatorLayout与web视图prombem

问题描述:

我使用CoordinatorLayout在我的应用程序的WebView。
但我喜欢哈瓦在图片的问题:
4.4 +。我不知道什么是我的布局问题。任何能帮助我吗?真的感谢

i am using CoordinatorLayout with webview in my app. but i hava a problem like the image : on 4.4+.i don't know what's the problem with my layout. any can help me? really thanks

这是我的XML布局。

<?xml version="1.0" encoding="utf-8"?>

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

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="256dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:id="@+id/backdrop"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                app:layout_collapseMode="parallax" />

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

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


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

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

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="16dp">

            <WebView
                android:id="@+id/webview"
                style="@style/Widget.CardContent"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:minHeight="100dp">


            </WebView>


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

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

    <com.getbase.floatingactionbutton.FloatingActionButton xmlns:fab="http://schemas.android.com/apk/res-auto"
        android:id="@+id/floatingaction"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:clickable="true"
        app:layout_anchor="@id/appbar"
        app:layout_anchorGravity="bottom|right|end"
        fab:fab_colorNormal="?attr/colorAccent"
        fab:fab_colorPressed="?attr/colorAccentDark" />

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

预计的布局:

Expected layout:

昨天我面临同样的问题,事实证明,这是一个的错误并修复被释放的Andr​​oid支持库22.2.1

I faced the same issue yesterday and it turns out that it's a bug and fix is released in Android Support Library 22.2.1.

请更新Android的支持库。这解决了我的问题。

Please update Android Support Library. This resolved my problems.