GeekedOut
GeekedOut

Reputation: 17185

Android - how to make horizontal buttons have no space between them?

Right now I have these buttons that line up nicely, but they have some space between them. To look like a more professional header, I would like to not have space between the buttons. Is that possible?

Here is my current layout:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
 android:orientation="horizontal"
>


 <Button android:id="@+id/home"
  android:layout_width="0dp" 
  android:layout_height="wrap_content"
  android:layout_weight="1"
  android:text="Home"
  android:textSize="11dp"
/>

<Button android:id="@+id/questions"
 android:layout_width="0dp" 
 android:layout_height="wrap_content"
 android:layout_weight="1"
 android:text="Questions"
 android:textSize="11dp"
android:layout_toRightOf="@+id/home"  />  


 <Button android:id="@+id/businesses"
  android:layout_width="0dp" 
  android:layout_height="wrap_content"
  android:layout_weight="1"
  android:textSize="11dp"
  android:text="Businesses"
  android:layout_toRightOf="@+id/questions"
 />  

 <Button android:id="@+id/learn"
  android:layout_width="0dp" 
  android:layout_height="wrap_content"
  android:layout_weight="1"
  android:text="Learn"
  android:textSize="11dp"
  android:layout_toRightOf="@+id/businesses"
 />  

</LinearLayout>

Thanks!

Upvotes: 0

Views: 562

Answers (1)

Kumar Bibek
Kumar Bibek

Reputation: 9127

You will need to change the images for the buttons. The default buttons that you are using, those backgrounds have some padding around them. that's why you see the space between them.

Since, you have a different use-case for the Buttons, you will need new images for them.

Upvotes: 3

Related Questions