0

On Image 1 I have a layout with some textview and edittext controls, when the user touches any EditText of this particular layout (other activities doesn't have this issue) the keypad appears in front of the EditText control so the user cannot see what he is writing, this is weird, image 2 shows the problem. Here is my XML:

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <EditText
            android:id="@+id/responsavelContratadaDiarioEditar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/TextView71"
            android:layout_marginBottom="10dp"
            android:ems="10"
            android:imeOptions="actionDone"
            android:singleLine="true" >

            <requestFocus />
        </EditText>

        <Button
            android:id="@+id/dataVistoriaDiarioEditar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/responsavelContratadaDiarioEditar"
            android:text="Data da Vistoria" />

        <TextView
            android:id="@+id/TextView81"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/dataVistoriaDiarioEditarTexto"
            android:text="Ponto de Controle"
            android:textSize="18sp"
            android:textStyle="bold" />

        <EditText
            android:id="@+id/pontoControleDiarioEditar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/TextView81"
            android:layout_weight="0.56"
            android:ems="10"
            android:gravity="top"
            android:imeOptions="actionDone"
            android:inputType="textMultiLine"
            android:maxLines="10"
            android:scrollbars="vertical"
            android:singleLine="false" />

        <TextView
            android:id="@+id/TextView71"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/projeto_spinnerDiarioEditar"
            android:text="Responsável contratada"
            android:textSize="18sp"
            android:textStyle="bold" />

        <Spinner
            android:id="@+id/projeto_spinnerDiarioEditar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/textView11"
            android:spinnerMode="dialog" />

        <TextView
            android:id="@+id/textView11"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginTop="14dp"
            android:text="Projeto"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="18sp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/dataVistoriaDiarioEditarTexto"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/dataVistoriaDiarioEditar"
            android:layout_toRightOf="@+id/dataVistoriaDiarioEditar"
            android:clickable="false"
            android:text="23/12/1989" />

    </RelativeLayout>

</LinearLayout>

Image1 Image2

Thanks.

crawletas
  • 127
  • 1
  • 14
  • possible duplicate of [Android soft keyboard covers edittext field](http://stackoverflow.com/questions/3295672/android-soft-keyboard-covers-edittext-field) – madteapot Jun 25 '14 at 15:25
  • @Setu none of the answers from this topic helped me – crawletas Jun 25 '14 at 15:32
  • Ok then @crawletas you might want to consider what you can do to make your layout work as you wanted. firstly I would ask why do you need LinearLayout and RelativeLayout when you only have one child for LinearLayout? Make RelativeLayout your parent layout and try those solutions again. – madteapot Jun 25 '14 at 15:40

3 Answers3

2

Use the following attribute in your manifest file under <activity>:

        android:windowSoftInputMode="adjustPan"
TronicZomB
  • 8,667
  • 7
  • 35
  • 50
0

Use anyone of this in your manifest file under that actvity name.

<activity android:windowSoftInputMode="adjustResize" /> <activity android:windowSoftInputMode="adjustPan" />

Hari Haran
  • 1,543
  • 4
  • 13
  • 25
0

I added this code on my onCreate() method, after setContentView and it worked :)

this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

Cya and thanks.

crawletas
  • 127
  • 1
  • 14