У меня есть вид прокрутки (в основном для альбомной ориентации, поскольку у меня нет другого xml-файла, я использую android: configChanges = "direction"), который содержит RelativeLayout и внутри него есть линейный макет.*
Код выглядит следующим образом:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:background="@color/background"
android:padding="10dip" android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="center"
android:orientation="vertical">
<TextView android:textSize="24.5sp" android:textStyle="bold"
android:layout_height="wrap_content" android:layout_gravity="center"
android:text="@string/main_title" android:layout_width="wrap_content">
</TextView>
<ImageView android:src="@drawable/icon"
android:layout_marginTop="20px" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="center" />
<TextView android:textSize="15sp" android:layout_marginTop="20px"
android:layout_height="wrap_content" android:text="@string/time_window_please_select_label"
android:layout_width="wrap_content"></TextView>
<Spinner android:layout_height="wrap_content" android:id="@+id/spinner"
android:prompt="@string/time_window_prompt" android:layout_width="fill_parent"></Spinner>
<Button android:layout_height="wrap_content"
android:layout_marginTop="20px" android:id="@+id/start_button"
android:text="@string/start_label" android:layout_width="fill_parent"></Button>
<TextView android:layout_height="wrap_content"
android:layout_marginTop="20px" android:id="@+id/status_label"
android:layout_width="wrap_content"></TextView>
<TextView android:layout_height="wrap_content"
android:layout_marginTop="20px" android:id="@+id/status_time_label"
android:layout_width="wrap_content">
</TextView>
</LinearLayout>
<ImageView android:id="@+id/info_button" android:src="@drawable/info"
android:layout_alignParentBottom="true" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="bottom|right" />
</RelativeLayout>
</ScrollView>
Все отлично работает, как в портретном, так и в ландшафтном режиме, за исключением ImgView (info_button) в самом конце.Я использовал Относительную компоновку, потому что думал, что смогу расположить ее в правом нижнем углу экрана (желательно немного отступа справа и снизу) экрана ...
Это то, что я получаювместо этого ...
http://www.doc.ic.ac.uk/~am907/wrong.png
любая помощь приветствуется!
РЕДАКТИРОВАТЬ: ссылка на полный файл XML http://pastebin.com/Cce4AC4v (по какой-то причине я могуне вижу всего этого в режиме предварительного просмотра, но он есть, когда я пытаюсь повторно скопировать в текстовой форме)
Спасибо andreas