4

I am making the page exactly as in the image link given below But I am not getting how can I achieve the golden border for the button get started, Please help thank you

Link- http://cdn9.staztic.com/app/a/2256/2256036/muthoot-fincorp-my-jewel-box-4103-0-s-307x512.jpg

Shri
  • 77
  • 1
  • 1
  • 5
  • Set a background with that color for the button. and then add a 2dp or 3dp padding. you will get that effect. – SKK Sep 23 '13 at 09:18
  • just create a custom layout for the button using appropriate xml files.follow this link for an example http://stackoverflow.com/questions/18507351/how-to-create-custom-button-in-android-using-xml-styles – krishna Sep 23 '13 at 09:18
  • create drawable with shape rect and add use that color code for golden to set to border. – Sumant Sep 23 '13 at 09:22
  • Use XML shape, stroke is the line around your view ^^ make it 1px or 2px – An-droid Sep 23 '13 at 09:41

1 Answers1

30

Create a drawable shape in your drawable folder like this,

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="rectangle">
  <gradient android:startColor="#FFFFFF" 
    android:endColor="#FFFFFF"
    android:angle="270" />
  <corners android:radius="3dp" />
  <stroke android:width="5px" android:color="#eecc68" />
</shape>

and in your .xml put like below,

<Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView1"
        android:layout_below="@+id/textView1"
        android:layout_marginLeft="52dp"
        android:layout_marginTop="39dp"
        android:background="@drawable/button"
        android:text="Button" />
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396