toolbar添加背景
程序员文章站
2022-06-23 08:29:08
drawable:toolbar_shadow
drawable:toolbar_shadow
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:angle="90"
android:startColor="@android:color/transparent"
android:endColor="#FFC2C0C0">
</gradient>
</shape>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_44"/>
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_below="@+id/toolbar"
android:background="@drawable/toolbar_shadow"/>
本文地址:https://blog.csdn.net/qq_46237697/article/details/109379167