Screen and Keyboard Configuration

1

Well, I have a certain difficulty: I created a form in android studio to insert some information, as in figure 1.

Inallfields,Icanentertheinformationwithoutproblems.However,whenIenterthelastfield(whosehintis"insert a description of your event"), the keyboard covers the view, and I can not see what is being entered, but the typed text is inserted, and I can see when I retreat the keyboard. (Figure 2)

.

I'veeventriedtoputaScrollViewcoveringthewholepage,butitdidnotwork.Doesanyonehavethesolution?

Thexmlcodeisattached

<Spinnerandroid:id="@+id/tipoDeEvento"
    android:layout_width="368dp"
    android:layout_height="40dp"
    android:layout_marginTop="16dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/cidadeEvento" />

<EditText
    android:id="@+id/nomeDoEvento"
    android:layout_width="368dp"
    android:layout_height="40dp"
    android:layout_marginTop="32dp"
    android:ems="10"
    android:hint="Insira o nome de seu evento"
    android:inputType="textPersonName"
    android:textSize="18sp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<EditText
    android:id="@+id/logradouroEvento"
    android:layout_width="368dp"
    android:layout_height="40dp"
    android:layout_marginTop="17dp"
    android:ems="10"
    android:hint="Insira o endereco do seu evento"
    android:inputType="textPersonName"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/nomeDoEvento" />

<EditText
    android:id="@+id/cidadeEvento"
    android:layout_width="368dp"
    android:layout_height="40dp"
    android:layout_marginTop="16dp"
    android:ems="10"
    android:hint="Insira a cidade de seu evento"
    android:inputType="textPersonName"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/logradouroEvento" />

<Spinner
    android:id="@+id/estadoEvento"
    android:layout_width="90dp"
    android:layout_height="40dp"
    android:layout_marginLeft="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="16dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/tipoDeEvento" />

<Button
    android:id="@+id/botaoSalvarEvento"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:text="Salvar"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/scrollView3"
    android:layout_marginRight="8dp"
    app:layout_constraintRight_toRightOf="parent"
    android:layout_marginEnd="8dp" />

<ScrollView
    android:id="@+id/scrollView3"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="16dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/estadoEvento"
    android:fadeScrollbars="false"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginEnd="8dp">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <EditText
            android:id="@+id/descricaoEvento"
            android:layout_width="match_parent"
            android:layout_height="117dp"
            android:layout_marginEnd="8dp"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="16dp"
            android:ems="10"
            android:hint="Insira uma descrição de seu evento"
            android:inputType="textMultiLine"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/estadoEvento" />
    </LinearLayout>
</ScrollView>

<Spinner
    android:id="@+id/valorEvento"
    android:layout_width="265dp"
    android:layout_height="40dp"
    android:layout_marginEnd="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="16dp"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/tipoDeEvento" />

    
asked by anonymous 16.06.2017 / 19:57

1 answer

0

I usually use the windowSoftInputMode attribute passing adjustPan as a parameter. See:

android:windowSoftInputMode="adjustPan"

Add this to your AndroidManifest.xml , in the activity where EditText is. See:

<activity
        android:name=".ActivityMain"
        ...
        android:windowSoftInputMode="adjustPan"
        />
    
16.06.2017 / 20:07