Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

enter image description here

Is there a way to fix this, but keep flag flagNoExtractUi ?

like image 821
Buda Gavril Avatar asked Sep 02 '25 09:09

Buda Gavril


2 Answers

Define <activity> inside Android manifest like:

<activity android:name=".TodoEdit"
            android:windowSoftInputMode="adjustResize">
like image 64
Paresh Mayani Avatar answered Sep 05 '25 00:09

Paresh Mayani


It seems to be a bug in Android but I found a solution! Just replace android:imeOptions="flagNoExtractUi" with android:imeOptions="flagNoFullscreen" and everything will work now.

like image 40
Mygod Avatar answered Sep 05 '25 01:09

Mygod