У меня есть представление, которое содержит несколько textViews ImageView и Button. Поскольку на устройствах с малым экраном (или в ландшафтном режиме на больших) не все видимы, я использую Scroll как родительский элемент всей иерархии, чтобы позволить пользователю просматривать всю информацию. Дело в том, что кнопка должна находиться в нижней части представления. Однако на большом экране устройства, где он остается достаточным пространством при буттоме, кнопка помещается сразу под последним текстом и, кажется, занимает все оставшееся пространство (что приводит к неактуальному виду). Пытаясь использовать android: allignParentButtom = "true" не только, что он не имеет никакого эффекта, но и помещает кнопку вверху экрана. Кто-нибудь знает, как я могу выполнить то, что я описал?ScrollView in android
вот XML
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<RelativeLayout
android:id="@+id/gps_info_page1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true">
<TextView
android:id="@+id/itsDateTimeValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/eStrUnknown">
</TextView>
<RelativeLayout
android:id="@+id/directions"
android:layout_centerHorizontal="true"
android:layout_below="@+id/itsDateTimeValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/itsDirectionValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:layout_marginRight="2dip"
android:textSize="20sp">
</TextView>
<TextView
android:id="@+id/itsOrientation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginLeft="2dip"
android:text="@string/eStrUnknown"
android:layout_toRightOf="@+id/itsDirectionValue">
</TextView>
</RelativeLayout>
<ImageView
android:id="@+id/itsImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/compass"
android:layout_below="@+id/directions"
android:layout_centerHorizontal="true">
</ImageView>
<RelativeLayout>
..."TextViews below the above image"
</RelativeLayout>
<RelativeLayout>
..."TextViews below the above"
</RelativeLayout>
<RelativeLayout>
..."TextViews below the above"
</RelativeLayout>
<RelativeLayout>
..."TextViews below the above"
</RelativeLayout>
<RelativeLayout
..."TextViews below the above"
</RelativeLayout>
<LinearLayout
android:id="@+id/div"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_below="@+id/sunset_layout"
android:background="#F333">
</LinearLayout>
<Button //adding here android:alignParentBottom="true" has described above behavior
android:layout_marginBottom="3dip"
android:layout_marginTop="20dip"
android:id="@+id/done_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/eStrDone"
android:textSize="18sp"
android:layout_below="@+id/div"
android:layout_centerHorizontal="true">
</Button>
</RelativeLayout>
</ScrollView>
Просто чтобы быть ясно, Вы хотите что-то вроде этого ?: http://tinyurl.com/3azuawt –