ByeBurger icon indicating copy to clipboard operation
ByeBurger copied to clipboard

toolbar会遮挡住部分recyclerView

Open LinHuanTanLy opened this issue 7 years ago • 2 comments

<android.support.design.widget.CoordinatorLayout>

<Viewpager /><--! 这里放你的布局内容,可以是任意view--> <Toolbar app:layout_behavior="@string/bye_burger_title_behavior" /> <BottomTab android:layout_gravity="bottom" app:layout_behavior="@string/bye_burger_bottom_behavior" />
<FloatingActionButton app:layout_behavior="@string/bye_burger_float_behavior" /> </android.support.design.widget.CoordinatorLayout>

这个样子的话,toolbar不会遮挡住recyclerView吗

LinHuanTanLy avatar Dec 08 '17 02:12 LinHuanTanLy

可以使用appbarlayout

githubwing avatar Dec 08 '17 02:12 githubwing

` <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/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" android:orientation="vertical">

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar
        android:id="@+id/tlMainToolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/colorPrimary"
        app:layout_behavior="@string/bye_burger_title_behavior"
        app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>


<catplay.kotlin.widget.NoScrollViewPager
    android:id="@+id/vpMainContent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

<android.support.design.widget.BottomNavigationView
    android:id="@+id/byeMainMenu"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="@color/colorPrimary"
    app:itemIconTint="@color/main_white_color"
    app:itemTextColor="@color/main_white_color"
    app:layout_behavior="@string/bye_burger_bottom_behavior"
    app:menu="@menu/bottom"/>


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fBtnMainBall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|right"
    android:layout_marginBottom="60dp"
    android:layout_marginEnd="@dimen/margin_10"
    android:layout_marginRight="@dimen/margin_10"
    app:backgroundTint="@color/colorPrimary"
    app:layout_behavior="@string/bye_burger_float_behavior"/>

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

在NoScrollViewPager中加入: app:layout_behavior="@string/appbar_scrolling_view_behavior"

LinHuanTanLy avatar Dec 08 '17 06:12 LinHuanTanLy