Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/182.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 Softkeyboard - Fatal编程技术网

Android 在安卓系统中,当软键盘出现在视图前面时,布局应该上升

Android 在安卓系统中,当软键盘出现在视图前面时,布局应该上升,android,android-softkeyboard,Android,Android Softkeyboard,我有一个问题,我有一个登录屏幕,当我们点击编辑文本时,软输入键盘会覆盖两个小部件,一个是文本视图,另一个是相对布局的登录按钮,但我想当我们选择任何编辑文本时,整个相对布局应该会上升,所有小部件都可以在Android默认的软输入键盘上看到。请给我建议正确的解决方案 提前谢谢 我的布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk

我有一个问题,我有一个登录屏幕,当我们点击编辑文本时,软输入键盘会覆盖两个小部件,一个是文本视图,另一个是相对布局的登录按钮,但我想当我们选择任何编辑文本时,整个相对布局应该会上升,所有小部件都可以在Android默认的软输入键盘上看到。请给我建议正确的解决方案

提前谢谢

我的布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="#ffffff">
    <FrameLayout android:id="@+id/frame"
        android:layout_gravity="top|bottom|center_horizontal"
        android:layout_width="wrap_content" android:layout_marginTop="10dip" android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:background="@drawable/logo" >
</ImageView>
    </FrameLayout>
    <RelativeLayout android:id="@+id/frameLayout1"
        android:layout_width="wrap_content" android:background="@drawable/login_box_bg"
        android:layout_gravity="center_horizontal" android:layout_height="220dip" android:layout_marginTop="20dip">
        <EditText android:id="@+id/ed_Login_Email"
            android:background="@drawable/login_input_bg" android:layout_gravity="center_horizontal" android:layout_marginTop="10dip" android:hint="Email:" android:paddingLeft="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="text" android:layout_centerHorizontal="true">
        </EditText>
        <EditText android:background="@drawable/login_input_bg" android:layout_gravity="center_horizontal" android:id="@+id/ed_Login_Pwd"
            android:inputType="textPassword" android:hint="Password:" android:paddingLeft="10dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="50dip" android:layout_centerHorizontal="true">
        </EditText>

        <ImageView
            android:id="@+id/img_Login_RememberUnchecked"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:background="@drawable/checkbox_unchkd_large" android:layout_gravity="top|left" android:layout_marginLeft="15dip" android:layout_marginTop="100dip" android:clickable="true"/>

        <TextView
            android:id="@+id/tv_Login_RememberMeUnchecked"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Remember Me" android:textColor="#000000" android:layout_gravity="top|left" android:layout_marginLeft="35dip" android:layout_marginTop="102dip" android:clickable="true"/>

        <Button
            android:id="@+id/btn_Login_Login"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/tv_Login_RememberMeUnchecked"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="14dp"
            android:background="@drawable/login_btn_bg"
            android:text="LOG IN"
            android:textColor="#ffffff" />

        <TextView
            android:id="@+id/tv_Login_ForgotPwd"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="15dp"
            android:clickable="true"
            android:text="Forgot your password?"
            android:textColor="#000000" />

    </RelativeLayout>


</LinearLayout>

请参阅以下图片以了解更多信息:


我尝试过android:WindowsOfInputMode=“stateVisible | adjustResize”,但没有发生任何变化,问题仍然是一样的。

请将windows软输入模式更改为Resize,将模式更改为“Resize”,将以下语句添加到AndroidManifest文件中的活动中

<activity android:name="YourActivityName" android:windowSoftInputMode="adjustResize">


这能帮你吗?查看编辑文本的不同软输入模式我们如何检查不同的软输入模式?用户说他已经尝试了
adjustResize
。你为什么再告诉他?