uu直播快3平台_UU快3直播官方

【Android错误集锦】AppBarLayout is overlapping the RecyclerView in one of my xml files.

时间:2020-01-29 01:39:07 出处:uu直播快3平台_UU快3直播官方

<android.support.v7.widget.RecyclerView

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_below="@id/toolbar"

android:id="@+id/recycler_view"

android:layout_centerVertical="true"

android:layout_centerHorizontal="true"

app:layout_behavior="@string/appbar_scrolling_view_behavior" />

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

附参考博客:

<android.support.design.widget.AppBarLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:theme="@style/AppTheme.AppBarOverlay">

https://stackoverflow.com/questions/38301099/appbarlayout-overlaps-recyclerview

<android.support.v7.widget.Toolbar

android:id="@+id/toolbar"

android:layout_width="match_parent"

android:layout_height="?attr/actionBarSize"

android:background="?attr/colorPrimary"

app:popupTheme="@style/AppTheme.PopupOverlay" />

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

处里法律法律依据 :

在activity_main.xml里边CoordinatorLayout布局下 即与AppBarLayout布局并列下加在 如下代码

If you don't want the coordinated toolbar scrolling, replace CoordinatorLayout with a vertical LinearLayout.

<android.support.design.widget.FloatingActionButton

android:id="@+id/fab"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="bottom|end"

android:layout_margin="@dimen/fab_margin"

app:srcCompat="@android:drawable/ic_dialog_email" />

When you are using CoordinatorLayout and AppBarLayout, you are setting up for that coordinated scrolling where the toolbar pushes out of the way first. But in order to get that, you need to give the view below the toolbar the appbar scrolling view behavior. This not only sets up the coordinated scroll, but tells the CoordinatorLayout to layout the lower view so that it appears beneath the toolbar.

问题图片图片问题图片图片:recyclerview 中的顶部数据被appbar遮盖,如下图红框所示

热门

热门标签