Copy & Paste the below code to drawable folder to create attractive buttons
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@color/btngreen"
android:endColor="@color/btngreen1"
android:angle="90"
/>
<corners android:bottomLeftRadius="5dip"
android:topRightRadius="5dip"
android:topLeftRadius="5dip"
android:bottomRightRadius="5dip"/>
</shape>
Then in your layout Button field, set background for button & see the attractive buttons thru xml
<Button
android:id="@+id/attractivebtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textColor="#ffffff"
android:background="@drawable/btn_bgg"
android:text="Button" />
android:id="@+id/attractivebtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textColor="#ffffff"
android:background="@drawable/btn_bgg"
android:text="Button" />
Now you get attractive buttons.
0 comments:
Post a Comment