我正在开发一个包含一些文本视图和按钮的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'。 –