简体   繁体   English

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

[英]keyboard hide edit text position not scroll up when typing in fragment

I have fragment Inside the fragment and there, at bottom I put edit text. 我有片段在片段的内部,在底部放置了编辑文本。 When I am typing on edit text keyboard is getting open which is hiding form, My form view is not scrolling up to see all the textboxes. 当我在编辑文本键盘上输入的内容正在打开时,它隐藏了表单,我的表单视图没有向上滚动以查看所有文本框。

Just put your codes in ScrollView. 只需将您的代码放在ScrollView中即可。 Check the example below 检查下面的例子

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM