我想实现一个水平的linerlayout,基中放4个button,并且使这4个button点的比例分别为:20%,20%,20%,40%。 按说设定layout_weight属性就可以了,但出来的效果总是不对,请高手看看怎么回事?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1"
/>
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1"
/>
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1"
/>
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="2"
/>
</LinearLayout>
</LinearLayout>

怎么会这样,求解决!!
另外,再问下button控件设定background属性后,为什么text设定的属性不显示了?有什么办法能让它正常显示text属性么?