put space between android buttons

Dilshi picture Dilshi · Aug 3, 2013 · Viewed 46.2k times · Source
<Button
    android:id="@+id/o_pharmacy"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/p2"
    android:text="@string/o_pharmacy"
    android:textSize="26sp" />

<Button
    android:id="@+id/lab"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/lab"
    android:text="@string/lab"
    android:textSize="26sp" />

<Button
    android:id="@+id/i_pharmacy"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/p1"
    android:text="@string/i_pharmacy"
    android:textSize="26sp" />

I tried above code to display 3 buttons in Liner layout. It works but I need to put space between the two buttons.

Answer

Chor Wai Chun picture Chor Wai Chun · Aug 3, 2013
android:layout_margin="10dp"

for each button