4

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 ?

Buda Gavril
  • 21,409
  • 40
  • 127
  • 196
  • Some possible answers are given on the given link : http://stackoverflow.com/questions/3295672/android-soft-keyboard-covers-edittext-field – Daud Arfin Aug 06 '12 at 09:51
  • did you try android:windowSoftInputMode="stateVisible|adjustResize" in activity tag in menifest file http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft – rajpara Aug 06 '12 at 09:53
  • yes. So my problem is that It looks like this with keyboard showed. I don't have a problem with showing or hiding the keyboard, but it have to look o with both keyboard on and off in landscape – Buda Gavril Aug 06 '12 at 10:04

3 Answers3

4

Define <activity> inside Android manifest like:

<activity android:name=".TodoEdit"
            android:windowSoftInputMode="adjustResize">
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • I've done this but it doesn't work. see my last comment from the question – Buda Gavril Aug 06 '12 at 10:05
  • What is that flag *flagNoExtractUi*, heard for the first time in Android. – Paresh Mayani Aug 06 '12 at 10:06
  • Used to specify that the IME does not need to show its extracted text UI. For input methods that may be fullscreen, often when in landscape mode, this allows them to be smaller and let part of the application be shown behind. Though there will likely be limited access to the application available from the user, it can make the experience of a (mostly) fullscreen IME less jarring. Note that when this flag is specified the IME may not be set up to be able to display text, so it should only be used in situations where this is not needed. – Buda Gavril Aug 06 '12 at 10:14
2

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.

Mygod
  • 2,077
  • 1
  • 19
  • 43
1

You can add a ScrollView so that when appears the keyboard, it scrolls automatically to make the view fully visible.

anonymous
  • 1,320
  • 5
  • 21
  • 37