Android rectangle shape with two different color
问题 how can I create rectangle shape by using two different colors with shadow? like above image. 回答1: Please create a drawable file and put the below code in it. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle" > <size android:height="20dp" /> <solid android:color="#F66D08" /> </shape> </item> <item android:top="50dp"> <shape android:shape="rectangle" > <gradient android:endColor="#AD1B1D"