我正在開發一個包含一些文本視圖和按鈕的Android應用程序。在MultiViewine TextView中TextView結束後放置按鈕?
我需要把按鈕放在文本視圖之後。當我的TextView是單線,運行良好。但是,當使用多行文本視圖時,我的按鈕被放置到第1行的末尾。
如何將按鈕放在正確的位置(在文本視圖的最後一行之後)?
編輯後:
這是我的xml,我在我的代碼中使用它並動態生成它。
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:shrinkColumns="1"
android:stretchColumns="1" >
<TableRow android:id="@+id/tableRow1" >
<Button
android:id="@+id/ayehPlace_btnCounter"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ayeh_counter"
android:text="" />
<TextView
android:id="@+id/ayehPlace_txtAyeh"
android:layout_width="wrap_content"
style="@style/ayehPlace_txt"
android:layout_height="wrap_content"
android:text="" />
</TableRow>
</TableLayout>
嘗試使用android:baselineAligned =「」 – KOTIOS
放置您的佈局代碼或顯示它的一些粗略草圖。 –
聽起來像你正在尋找'android:gravity =「bottom」'你的(大概)水平'LinearLayout'。 –