2012-05-18 68 views
0

现在我有这些按钮排列很好,但他们之间有一些空间。 看起来像一个更专业的标题,我想在按钮之间没有空间。那可能吗?Android - 如何让水平按钮之间没有空间?

这是我目前的布局:

<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> 

谢谢!

回答

3

您将需要更改按钮的图像。您正在使用的默认按钮,这些背景在它们周围有一些填充。这就是为什么你看到它们之间的空间。

因为,你有不同的按钮使用情况,你将需要新的图像。

相关问题