-1

This is my xml and I don't get that keyboard does not hide edittext.

I almost try everything.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:fitsSystemWindows = "true"
    android:background="@color/white">

    <!-- "ActionBar"  -->
    <FrameLayout
        android:id="@+id/layout_top"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:fitsSystemWindows = "true"
        android:layout_alignParentTop="true"
        android:background="@drawable/he">

            <Button
                android:layout_width="28dp"
                android:layout_height="28dp"
                android:background="@drawable/titlebar_back_selector"
                android:id="@+id/title_bar_left_menu"
                android:layout_gravity="left|center_vertical"
                android:layout_marginLeft="10dp"/>
        <TextView
            android:id="@+id/tv_nombre_juzgado"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-condensed"
            android:layout_marginRight="6dp"
            android:layout_marginLeft="60dp"
            android:text="Malaga"
            android:textSize="@dimen/textsize_xlarge"
            android:textColor="@android:color/white"/>

    </FrameLayout>

    <RelativeLayout
            android:layout_width="match_parent"
            android:orientation="vertical"
            android:background="#DCDCDC"
            android:layout_below="@+id/layout_top"
            android:layout_height="match_parent">

            <LinearLayout
                    android:id="@+id/informations_container"
                    android:layout_width="match_parent"
                    android:orientation="vertical"
                    android:background="@drawable/header"
                    android:paddingLeft="@dimen/activity_horizontal_margin_nuevo"
                    android:layout_height="50dp">



                    <LinearLayout
                        android:id="@+id/above_divider"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:weightSum="4">

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:text="Pedro Martinez Duran"
                            android:layout_marginTop="10dp"
                            android:layout_weight="3.4"
                            android:textSize="@dimen/textsize_medium_large1"
                            android:fontFamily="sans-serif-condensed"
                            android:id="@+id/tv_difunto"
                            android:textColor="@color/white_transparent" />
                        <TextView
                            android:id="@+id/tv_expediente"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:gravity="right"
                            android:text="458"
                            android:layout_marginRight="7dp"
                            android:layout_marginTop="10dp"
                            android:layout_weight="0.60"
                            android:textSize="@dimen/textsize_medium_large1"
                            android:fontFamily="sans-serif-condensed"
                            android:textColor="@color/white_transparent" />


                    </LinearLayout>

                </LinearLayout>

            <ListView
                android:id="@+id/lv_lista_comentarios"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_above="@+id/footer_section"
                android:layout_below="@+id/informations_container"
                android:layout_marginTop="5dp"
                android:background="#EEEEEE" />

            <LinearLayout
                android:id="@+id/footer_section"
                android:layout_alignParentBottom="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:weightSum="3"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="7dp">

                <EditText
                    android:imeOptions="flagNoFullscreen"
                    android:id="@+id/et_mensaje"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:singleLine="false"
                    android:layout_marginLeft="@dimen/activity_horizontal_margin_nuevo1"
                    android:padding="8dp"
                    android:layout_weight="1.8"
                    android:background="@color/white"
                    android:hint="Escribe un comentario"
                    android:textSize="@dimen/textsize_medium"
                    android:fontFamily="sans-serif-condensed"
                    android:inputType="textMultiLine"/>
                </LinearLayout>
        <LinearLayout
            android:layout_alignParentBottom="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:gravity="right"
            android:weightSum="3"
            android:layout_marginBottom="2dp"
            android:layout_marginTop="8dp">

                <com.special.utils.UICircularImage
                    android:id="@+id/bt_enviar"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:layout_marginRight="4dp"
                    android:padding="10dp"
                    android:layout_weight="0.2"
                    android:src="@drawable/enviar"
                    android:background="@color/transparent"
                    app:background_color="@color/white"
                    app:line_color="@android:color/white"
                    app:line_color_press="@color/theme_color"
                    app:line_width="0dp"
                    app:padding="0dp" />

            </LinearLayout>

        </RelativeLayout>



    </RelativeLayout>

Manifest

<activity
            android:name=".matias.fragments.ActivityComentariosPartida.ActivityComentariosPartida"
            android:label="@string/title_activity_detail_view"
            android:theme="@style/AppThemeTrans"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|adjustResize|stateHidden" >
        </activity>

1 Answer 1

3

Remove adjustPan value for android:windowSoftInputMode in your AndroidManifest.xml.

<activity
    ...
    android:windowSoftInputMode="adjustResize|stateHidden" >
</activity>

adjustPan value is explained on the official Android website as:

The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

Source: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.