Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbar会遮挡住部分recyclerView #16

Open
LinHuanTanLy opened this issue Dec 8, 2017 · 2 comments
Open

toolbar会遮挡住部分recyclerView #16

LinHuanTanLy opened this issue Dec 8, 2017 · 2 comments

Comments

@LinHuanTanLy
Copy link

<android.support.design.widget.CoordinatorLayout>

<--! 这里放你的布局内容,可以是任意view-->



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

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

@githubwing
Copy link
Owner

可以使用appbarlayout

@LinHuanTanLy
Copy link
Author

`
<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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants