Android ScrollView无法滚动

Jus*_*pez 2 android scrollview android-layout

我已经解决了我的问题.我选择了一个标题和一个页脚,它们总是分别位于屏幕的底部和顶部.然后我创建了一个"中心内容",我将其包含在ScrollView布局中.如果人们有兴趣了解它现在的样子,我已经更新了下面的代码.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:background="#FFFFFF">

    <LinearLayout android:id="@+id/header"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@layout/header"
        android:layout_alignParentTop="true">
        <ImageView android:src="@drawable/logo"
            android:contentDescription="@string/logo_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="10dip"/>
    </LinearLayout>

    <ScrollView android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="350dip"
        android:layout_below="@id/header">
        <LinearLayout android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="20dip" >
            <!--  Email Label -->
            <TextView android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:textColor="#372C24"
                android:text="@string/email"/>
            <EditText android:id="@+id/email_field"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dip"
                android:singleLine="true"
                android:inputType="textEmailAddress"/>
            <!--  Password Label -->
            <TextView android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dip"
                android:textColor="#372C24"
                android:text="@string/password"/>
            <EditText android:id="@+id/password_field"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:inputType="textPassword"/>
            <!-- Login button -->
            <Button android:id="@+id/login_button"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="25dip"
                android:text="@string/login"/>
            <!-- Register button -->
            <Button android:id="@+id/register_button"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="25dip"
                android:text="@string/register_button"/>
        </LinearLayout>
    </ScrollView>

    <LinearLayout android:id="@+id/footer"
        android:layout_width="fill_parent"
        android:layout_height="90dip"
        android:background="@layout/footer"
        android:layout_alignParentBottom="true">
    </LinearLayout>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

You*_*jae 5

对我来说,删除文件android:windowSoftInputMode="adjustPan"中的<activity>标签AndroidManifest.xml解决了问题.