Я пытаюсь выровнять кнопку справа от TableRow.Внутри TableRow у меня есть два просмотра текста и кнопка.Средний текстовый вид скрыт при отображении кнопки.Это делается в моем адаптере, устанавливая видимость textview как пропавшую.
Я не уверен, каков наилучший подход к выравниванию кнопки вправо, когда она отображается.
Вот мойФайл макета:
<?xml version="1.0" encoding="UTF-8" ?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget28"
android:stretchColumns="1"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingLeft="10sp"
android:descendantFocusability="blocksDescendants"
>
<TableRow>
<TextView
android:id="@+id/textTopLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium">
</TextView>
<TextView
android:id="@+id/textTopRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium">
</TextView>
</TableRow>
<TableRow>
<TextView
android:id="@+id/textBottomLeft"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall">
</TextView>
<TextView
android:id="@+id/textBottomRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall">
</TextView>
<Button
android:id="@+id/btnSessionResume"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Resume"
android:visibility="invisible"
android:layout_marginRight="20px"
android:layout_alignParentRight="true">
</Button>
</TableRow>
</TableLayout>
Кнопка находится в нижней части TableRow.
Вот скриншот того, как выглядит макет в настоящее время: