AppBarLayout - Layout sometimes invisible once it enters view (even if it's not entered)

后端 未结 1 912
[愿得一人]
[愿得一人] 2021-01-23 11:19

I have a problem where sometimes the AppBarLayout will not show its full content all the time when you play around with it:



        
相关标签:
1条回答
  • 2021-01-23 12:23

    This is a solution extending the one provided above: Use this instead of the one provided, which will blend the appbarlayout and the subtle shadow elevation below it.

    <View
        android:id="@+id/appbar_bottom"
        android:layout_width="match_parent"
        android:layout_height=".3dp"
        android:background="#606060"
        android:visibility="visible"/>
    

    and the resultant layout:

    <android.support.design.widget.AppBarLayout
            android:orientation="vertical"
            android:layout_height="148.3dp"
            android:layout_width="match_parent">
    
        <android.support.design.widget.TabLayout
                app:layout_scrollFlags="scroll|enterAlways"
                android:layout_height="48dp"
                android:background="@color/primarycolor"
                .../>
    
        <RelativeLayout
                app:layout_scrollFlags="scroll|enterAlways"
                android:background="@color/white"
                android:layout_height="100dp"
                ...>
        </RelativeLayout>
    
        <View
            android:id="@+id/appbar_bottom"
            android:layout_width="match_parent"
            android:layout_height=".3dp"
            android:background="#606060"
            android:visibility="visible"/>
    </android.support.design.widget.AppBarLayout>
    
    0 讨论(0)
提交回复
热议问题