How to use windowSoftInputMode="adjustNothing"

1

Good, I have a layout for an activity in which when I'm going to use the android keyboard it hides some views, I've been looking and they tell me that to solve it we should use the following attribute: android:windowSoftInputMode="adjustPan" .

I've tried to put it in the manifest within the activity and in this layout in the RelativeLayout that contains all the other Views but it still does not work, how should I use it?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="Insertar"
android:id="@+id/rl"
>

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay"
    android:id="@+id/view2">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways" />

</android.support.design.widget.AppBarLayout>

<LinearLayout
    android:id="@+id/formularioUd"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="@dimen/activity_horizontal_margin"
    android:layout_below="@+id/view2"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">
    <!--android:layout_below="@id/toolbarInsertarUD"-->

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/universal_margin"
        android:textColorHint="#5ca0d1">

        <EditText
            android:id="@+id/etNombre"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:textColor="@android:color/black"
            android:textColorHint="#000"/>
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/universal_margin"
        android:textColorHint="#5ca0d1">

        <EditText
            android:id="@+id/etDescripcion"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </android.support.design.widget.TextInputLayout>
</LinearLayout>

<Button
    android:id="@+id/btGuardar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:onClick="alClickearBoton"
    android:text="@string/insert"
    android:layout_below="@+id/formularioUd"
    android:layout_centerHorizontal="true"
    android:drawableLeft="@drawable/cross"
    android:background="#5ca0d1"
    android:textColor="#ffffff"
    android:paddingTop="5dp"
    android:paddingRight="5dp"
    android:paddingLeft="5dp"
    android:padding="10dp"
    android:drawablePadding="10dp"/>

    
asked by borjis 21.11.2016 в 17:38
source

2 answers

2

The attribute you indicate is actually a reference to a topic and is not a solution:

android:theme="@style/PLMS_Style"

To ensure the virtual keyboard does not cover the widget when activated, the property is added

android:windowSoftInputMode="stateUnchanged|adjustResize"

O

android:windowSoftInputMode="adjustPan"
    
answered by 21.11.2016 / 18:03
source
1

Ok, I have already found the solution, using android:windowSoftInputMode="adjustPan" in the declared activity in the manifest works perfectly.

    
answered by 21.11.2016 в 17:49