CoordinatorLayout(AppbarLayout) does not draw toolbar properly

前端 未结 1 1812
无人及你
无人及你 2020-12-30 02:29

I am using the new design support library to achieve scroll to hide toolbar. However, every thing works well if I don\'t load images by picasso. If I load images, sometimes

相关标签:
1条回答
  • 2020-12-30 02:51
    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
    
           <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways" />
    
           <View
            android:layout_width="fill_parent"
            android:layout_height="1dp"/>
    
        </android.support.design.widget.AppBarLayout>
    
        <FrameLayout
            android:id="@+id/main"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    
    </android.support.design.widget.CoordinatorLayout>
    

    Try this. I solved same problem by this snippet. I appended dummy view which has height of 1dp after the Toolbar.

    0 讨论(0)
提交回复
热议问题