Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 键盘隐藏编辑文本位置在键入片段时不向上滚动_Android_Android Layout_Android Recyclerview_Fragment_Android Fragmentactivity - Fatal编程技术网

Android 键盘隐藏编辑文本位置在键入片段时不向上滚动

Android 键盘隐藏编辑文本位置在键入片段时不向上滚动,android,android-layout,android-recyclerview,fragment,android-fragmentactivity,Android,Android Layout,Android Recyclerview,Fragment,Android Fragmentactivity,我在片段中有片段,在底部我放了编辑文本。当我在编辑文本键盘上键入时,它正在打开隐藏表单,我的表单视图不会向上滚动以查看所有文本框。只需将代码放在ScrollView中即可。检查下面的示例 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/login_form" androi

我在片段中有片段,在底部我放了编辑文本。当我在编辑文本键盘上键入时,它正在打开隐藏表单,我的表单视图不会向上滚动以查看所有文本框。

只需将代码放在ScrollView中即可。检查下面的示例

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:id="@+id/reg_no_login_form"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:background="#FFF"
    android:orientation="vertical"
    android:padding="8dp">


    <EditText
        android:id="@+id/password"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_margin="8dp"
        android:background="@drawable/rounded_login_input"
        android:hint="@string/prompt_password"
        android:inputType="textPassword"
        android:padding="8dp" />


    <Button
        android:id="@+id/btnID"
        style="?android:textAppearanceSmall"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="8dp"
        android:background="@drawable/btn_primary"
        android:text="@string/action_sign_in"
        android:textColor="#FFFFFF"
        android:textStyle="bold" />

</LinearLayout></ScrollView>

请发布您的xml代码