Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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,我有一个布局,看起来像第一个图像,当我打开软键盘时,看起来像第二个图像,但我想要它在第三个图像上的外观: 我在清单上读了很多关于adjustpan和adjustresize的内容,但都不起作用,xml结构是: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_pa

我有一个布局,看起来像第一个图像,当我打开软键盘时,看起来像第二个图像,但我想要它在第三个图像上的外观:

我在清单上读了很多关于adjustpan和adjustresize的内容,但都不起作用,xml结构是:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blanco"
android:gravity="top"
android:orientation="vertical"
android:weightSum="10" >

<!-- LOGO -->

<LinearLayout
    android:id="@+id/logo"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="3.7"
    android:background="@color/green_logo"
    android:orientation="vertical"
    android:gravity="center"
    android:paddingTop="65dp" >

    <ImageView
        android:id="@+id/logo_registro"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:src="@drawable/logo_registro" />
</LinearLayout>

<FrameLayout
    android:id="@+id/contentFragment"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="6.3" >

</FrameLayout>
</LinearLayout>

第一部分是带有应用程序徽标的绿色部分,在框架布局中,我放置了包含简单线性布局或与我的登录表单部分相关的片段。

将其放在活动内部的清单上

<activity android:name=".YourActivity"
              android:configChanges="keyboard|keyboardHidden"></activity>

在清单中设置WindowsOfInputMode以调整此活动的大小。有3种可能的设置-无,调整大小缩小你的应用程序以适应剩余空间,平移滚动你的应用程序,使聚焦字段保持在屏幕上。

只需添加空的滚动视图,它就会工作

 <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</ScrollView>

不工作,抱歉:我不想在默认情况下隐藏键盘,我想在键盘打开时屏幕滚动到我想要的位置,而不是自动调整到编辑文本。你尝试过这个吗?你找到解决这个问题的办法了吗?没有,我把这个问题悬而未决