简体   繁体   English

Android软键盘涵盖了横向的editText

[英]android soft keyboard covers editText in landscape

I have the following layout: 我有以下布局:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

    <LinearLayout
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:orientation="vertical"
            android:layout_above="@+id/edittext">

        <TextView
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:text="line1"/>

        <TextView
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:text="line2"/>

        <TextView
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:text="line3"/>

    </LinearLayout>

    <EditText
            android:id="@id/edittext"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:layout_margin="5dp"
            android:text="test"
            android:layout_alignParentBottom="true"
            android:imeOptions="flagNoExtractUi"
            />
</RelativeLayout>

and in landscape on a Nexus one it looks like: 在Nexus 1的横向上看起来像:

在此处输入图片说明

Is there a way to fix this, but keep flag flagNoExtractUi ? 有办法解决此问题,但保留标志flagNoExtractUi吗?

Define <activity> inside Android manifest like: 在Android清单中定义<activity>例如:

<activity android:name=".TodoEdit"
            android:windowSoftInputMode="adjustResize">

您可以添加ScrollView以便在出现键盘时自动滚动以使视图完全可见。

It seems to be a bug in Android but I found a solution! 这似乎是Android中的错误,但我找到了解决方案! Just replace android:imeOptions="flagNoExtractUi" with android:imeOptions="flagNoFullscreen" and everything will work now. 只需将android:imeOptions="flagNoExtractUi"替换为android:imeOptions="flagNoFullscreen" ,一切都将立即android:imeOptions="flagNoFullscreen"

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

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