Я столкнулся с проблемой, когда моя полоса прокрутки перекрывается элементом из моего макета. Я хотел бы, чтобы полоса прокрутки появилась после поля редактирования:
. При добавлении полосы прокрутки к различным частям XML-файла я получил сообщения об ошибках, которые, как я понимаю, означают, что представление прокрутки должно быть корневым элементом. В результате мой код выглядит следующим образом (когда я чувствую, что представление прокрутки должно появляться после первого линейного макета и / или поля редактирования):
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/db1_root"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout style="@style/TitleBar">
<ImageView style="@style/TitleBarLogo"
android:contentDescription="@string/description_logo"
android:src="@drawable/logo" />
<ImageView style="@style/TitleBarSeparator" />
<TextView style="@style/TitleBarText" />
<ImageButton style="@style/TitleBarAction"
android:contentDescription="@string/description_about"
android:src="@drawable/about"
android:onClick="onClickAbout" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:id="@+id/status"
android:layout_height="wrap_content">
<requestFocus></requestFocus>
</EditText>
<Button android:layout_width="wrap_content" android:text="Ok" android:textColor="@color/title_text" android:layout_gravity="center" android:background="@drawable/custom_button" android:layout_height="wrap_content"></Button>
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:text="" android:id="@+id/updates" android:textSize="14dp" android:layout_height="wrap_content"></TextView>
</LinearLayout>
<TextView android:text="" android:id="@+id/test" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</LinearLayout>
</LinearLayout>
</ScrollView>