CoordinatorLayout Toolbar invisible on enter until full height

前端 未结 1 958
北恋
北恋 2020-12-11 16:27

Included in my activity_main.xml\'s DrawerLayout is a CoordinatorLayout called content_layout.xml. Within this CoordinatorLayou

相关标签:
1条回答
  • 2020-12-11 17:07

    I was having this same issue and the only thing I found that solved it was by having something else other than the toolbar inside the AppBarLayout. I placed an invisible view in my layout underneath the toolbar. Not the most ideal solution, but it worked.

    <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">      
    
         <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
    
         <View
            android:id="@+id/appbar_bottom"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@android:color/transparent"
            android:visibility="invisible"/>
    
    </android.support.design.widget.AppBarLayout>
    
    0 讨论(0)
提交回复
热议问题