I want to build a button with 3 different color in the background like the attached image, and I have no idea how to do that with shapes
Thank you for you help.
I want to build a button with 3 different color in the background like the attached image, and I have no idea how to do that with shapes
Thank you for you help.
Use ImageButton and use above image as background of that button:
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/YOUR_BTN_IMG"/>
1st make a xml file in drawable folder with bg1 name and put this code
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:centerColor="#4CAF50"
android:endColor="#2E7D32"
android:startColor="#b5e7b7"
android:type="linear" />
</shape>
than where ever you want it use like
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bg1"/>
here u change angle,start end and center color as per your requirement