Scrowview layout

Asked

Viewed 37 times

0

I have a problem with the Scrowview layout, like, I have a form with 7 fields to be filled out, but when the keyboard appears to fill in the information, the first editText go up, and the scrowview does not go up so I can visualize itmaking it impossible for me to fill them in, can someone explain to me how I solve this?

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:layout_gravity="center"
    android:weightSum="1">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CADASTRO ODONTEC"
        android:layout_gravity="center_horizontal"
        android:textColor="#FFFFFF"
        android:textSize="25dp"
        />

    <LinearLayout
        android:layout_width="338dp"
        android:layout_height="338dp"
        android:layout_gravity="center"
        android:gravity="center"
        android:background="@drawable/fundolinearcada"
        android:orientation="vertical"
        android:layout_marginTop="30dp"
        tools:context="com.des.odontec.equipe.odontec.View.MainActivity_Login"
        android:weightSum="1"
        >



        <EditText

            android:id="@+id/nomeUsuario"
            android:layout_width="292dp"
            android:layout_height="43dp"
            android:layout_gravity="center"
            android:layout_marginTop="0dp"
            android:hint="Digite seu nome"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:ellipsize="start"
            android:background="@drawable/edittextfundo"
            android:inputType="text"
            android:textColorHint="#696969"


            />



        <EditText
            android:id="@+id/emailUsuario"
            android:layout_width="292dp"
            android:layout_height="43dp"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:ellipsize="start"
            android:background="@drawable/edittextfundo"
            android:hint="Digite seu email"
            android:inputType="textEmailAddress"
            android:textColorHint="#696969"
            />


        <EditText
            android:id="@+id/senhaUsuario"
            android:layout_width="292dp"
            android:layout_height="43dp"
            android:background="@drawable/edittextfundo"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:ellipsize="start"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:hint="Digite sua senha"
            android:inputType="textPassword"
            android:textColorHint="#696969"
            />



        <EditText
            android:id="@+id/confirSenhaUsuario"
            android:layout_width="292dp"
            android:layout_height="43dp"
            android:background="@drawable/edittextfundo"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:ellipsize="start"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:hint="Confirmar senha"
            android:inputType="textPassword"
            android:textColorHint="#696969"
            />



        <EditText
            android:id="@+id/estadoUsuario"
            android:layout_width="292dp"
            android:layout_height="43dp"
            android:background="@drawable/edittextfundo"
            android:layout_gravity="center"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:ellipsize="start"
            android:layout_marginTop="10dp"
            android:hint="Estado"
            android:inputType="text"
            android:textColorHint="#696969"
            />


        <EditText
            android:id="@+id/cidadeUsuario"
            android:layout_width="292dp"
            android:layout_height="43dp"
            android:background="@drawable/edittextfundo"
            android:layout_gravity="center"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:ellipsize="start"
            android:layout_marginTop="10dp"
            android:hint="Cidade"
            android:inputType="text"
            android:textColorHint="#696969"
             />


    </LinearLayout>

    <Button
        android:id="@+id/btSalvar"
        android:layout_marginTop="15dp"
        android:layout_width="242dp"
        android:layout_height="37dp"
        android:layout_gravity="bottom|center"
        android:background="@drawable/botaoodontec"
        android:gravity="center"
        android:onClick="salvar"
        android:text="Salvar"
        android:textColor="#FFFFFF" />

    <FrameLayout
        android:id="@+id/fl2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/transparencia"
        android:layout_gravity="center"
        android:visibility="gone">

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center" />
    </FrameLayout>


</LinearLayout>

1 answer

0

Victor,

To solve this problem, you must go to Androidmanifest.xml and change your Activity record there, for example:

<activity
    android:name=".NomeDaActivity"   
    android:windowSoftInputMode="adjustPan"
    android:theme="@style/AppThemeNoActionBar">
</activity>

You must add the line android:windowSoftInputMode="adjustPan"

This way, Java will understand, that in this Activity, when the virtual keyboard is opened, the editText that was clicked will be pushed up the keyboard.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.