我看到簡單按鈕的奇怪行爲,當他們的文本分裂在幾行。我有更復雜的情況,但即使是最簡單的情況也是如此。有了這個佈局:對齊線下的多行文字按鈕按鈕,如何解決?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<Button android:layout_width="100dip" android:layout_height="70dip" android:text="111" />
<Button android:layout_width="100dip" android:layout_height="70dip" android:text="111 222 333" />
<Button android:layout_width="100dip" android:layout_height="70dip" android:text="111 222 333 444 555 666" />
<Button android:layout_width="100dip" android:layout_height="70dip" android:text="111" />
</LinearLayout>
結果是:
按鈕下去,打倒文字的每一下一行。我希望他們排隊。這是一個android bug,以及如何解決它?
它沒有錯誤,按鈕的文字基線與其他按鈕對齊。將'LinearLayout'的'baselineAligned'設置爲'false'將會解決這個問題。 – xmen 2013-12-27 03:28:17