0

次のレイアウトがスクロールできない理由は何ですか? 私は を持ってRelativeLayoutScrollViewます。ビューは画面に収まります。ただし、キーボードがポップアップするたびにカバーされます。キーボードがポップアップしたときに画面をスクロール可能にしたいのは、ログインとパスワードの EditBox をカバーしているため、誰かが入力しているものを見るのが難しいからです。

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <com.alarm.alarmmobile.android.view.RobotoLightTextView
            android:id="@+id/passcode_login_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginTop="20dp"
            android:text="@string/passcode_login_body"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <EditText
            android:id="@+id/passcode_login_username"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/passcode_login_text"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginTop="20dp"
            android:hint="@string/login_textview_username"
            android:singleLine="true" />

        <EditText
            android:id="@+id/passcode_login_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/passcode_login_username"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:hint="@string/login_textview_password"
            android:inputType="textPassword"
            android:singleLine="true" />

        <com.alarm.alarmmobile.android.view.RobotoLightButton
            android:id="@+id/passcode_login_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_below="@id/passcode_login_password"
            android:layout_marginRight="16dp"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:text="@string/login_button_login" />

    </RelativeLayout>

</ScrollView>
4

3 に答える 3

1

これをマニフェストに含めます。

<activity android:name="..." // your activity here
    ....
    android:windowSoftInputMode="adjustResize|adjustPan">
/>

注:追加adjustPanによって問題が再発するかどうかは不明です。

于 2014-07-25T16:04:00.713 に答える