How to get this view of button with gradient background?
I googled a lot but hadn't find something
and I think overlapping of one on other is because of relative layout..
How to get this view of button with gradient background?
I googled a lot but hadn't find something
and I think overlapping of one on other is because of relative layout..
Create a xml file in drawable folder:
oval_background.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<gradient
android:startColor="#6586F0"
android:centerColor="#D6D6D6"
android:endColor="#4B6CD6"
android:angle="90"/>
</shape>
Use this file as button background:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/oval_background"
android:id="@+id/ButtonTest"
android:text="button">
</Button>