make good button in android

//add this at drawable <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" > <shape android:shape="rectangle" > <corners android:radius="3dip" /> <stroke android:width="1dip" android:color="#5e7974" /> <gradient android:angle="-90" android:startColor="#345953" android:endColor="#689a92" /> </shape> </item> <item android:state_focused="true"> <shape android:shape="rectangle" > <corners android:radius="3dip" /> <stroke android:width="1dip" android:color="#5e7974" /> <solid android:color="#58857e"/> </shape> </item> <item > <shape android:shape="rectangle" > <corners android:radius="3dip" /> <stroke android:width="1dip" android:color="#5e7974" /> <gradient android:angle="-90" android:startColor="#8dbab3" android:endColor="#58857e" /> </shape> </item> </selector> // then add the button in your XML of your Activity <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dp" android:textColor="#ffffff" android:background="@drawable/mybutton" android:text="Buttons" />

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.