知道为什么以下布局不可滚动吗?我有RelativeLayout
一个ScrollView
。视图适合屏幕。但是,只要键盘弹出,它们就会被覆盖。我想在键盘弹出时使屏幕可滚动,因为它覆盖了登录名和密码编辑框,所以很难看到有人在输入什么
<?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>