Part of Fragment items hides under Action bar

前端 未结 2 1466
北海茫月
北海茫月 2021-02-07 19:11

I am learning android dev and my question might be very simple. I am stuck at the below part and requesting your help

Description

I am using the

相关标签:
2条回答
  • 2021-02-07 19:30

    use FrameLayout instead of LinearLayout and add this to your FrameLayout of the fragment

    android:layout_marginTop="?attr/actionBarSize"
    

    at leaset worked for me.

    0 讨论(0)
  • 2021-02-07 19:41

    This might come from the default behaviour of the CoordinatorLayout. I also assume that you add your fragments in the frameLayout frameCheck. In your app bar code layout, replace

    <FrameLayout
        android:id="@+id/framecheck"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </FrameLayout>
    

    with :

    <FrameLayout
        android:id="@+id/framecheck"
        app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    
    0 讨论(0)
提交回复
热议问题