我正在处理一个包含5个按钮的碎片。当它在像平板这样的更大屏幕上时,我使用一个将所有5个按钮放在顶部的碎片。我将它们的layout_width都设置为1,但是按钮并没有像预期那样均匀地分布在屏幕上。
期望结果: [ all ][ my ][buttons][ go ][ here ]
实际结果: b1 b2 b3 b4 b5 b3和b5只是一个按钮...只是显示它破坏一个单词并将其放在一行下面。 [all][my][but ][go][her] 并把它放在下面一行。 [tons] [e ]
我尝试了不同的方法,但是无法使其改变。任何帮助将不胜感激。谢谢。
期望结果: [ all ][ my ][buttons][ go ][ here ]
实际结果: b1 b2 b3 b4 b5 b3和b5只是一个按钮...只是显示它破坏一个单词并将其放在一行下面。 [all][my][but ][go][her] 并把它放在下面一行。 [tons] [e ]
我尝试了不同的方法,但是无法使其改变。任何帮助将不胜感激。谢谢。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/xlarge_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/tip_btn"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="@string/tip_button"
android:onClick="tipButton">
</Button>
<Button
android:id="@+id/preference"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="@string/settings"
android:onClick="showPreferences">
</Button>
<Button
android:id="@+id/rate_btn"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="@string/rate_button"
android:onClick="rateButton">
</Button>
<Button
android:id="@+id/feedback_btn"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="@string/feedback_button"
android:onClick="feedbackButton">
</Button>
<Button
android:id="@+id/cancel_btn"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="@string/exit_button"
android:onClick="cancelButton">
</Button>
</LinearLayout>