XML layout with problems

Asked

Viewed 251 times

0

I have a problem, I have a layout with some fields Edit Text, what happens is that the Scrollview that I use works for all fields of Activity except for the button that ends up going down the screen. Does anyone have a good idea what I can do? OBG desd.

<?xml version="1.0" encoding="utf-8"?>

android:orientation="vertical">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

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

        <LinearLayout
            android:id="@+id/fields_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="50dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:orientation="vertical"
            android:padding="10dp"
            android:layout_weight="1.24">


            <android.support.design.widget.TextInputLayout
                android:id="@+id/nomeNsocio"
                android:layout_width="match_parent"

                android:layout_height="wrap_content">

                <EditText
                    android:id="@+id/TxtNome"
                    android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Nome/Empresa"
                    android:inputType="text"
                    android:singleLine="true" />


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

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

                <EditText
                    android:id="@+id/TxtEmail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Email"
                    android:inputType="textEmailAddress"
                    android:singleLine="true" />


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

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

                <EditText
                    android:id="@+id/TxtTelefone"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Telefone"
                    android:inputType="number"
                    android:singleLine="true" />


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

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

                <EditText
                    android:id="@+id/TxtSenha"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Senha"
                    android:inputType="textPassword"
                    android:singleLine="true" />


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

                <EditText
                    android:id="@+id/TxtSenha2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Confirmar Senha"
                    android:inputType="textPassword"
                    android:singleLine="true" />


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

        </LinearLayout>

        <Button
            android:id="@+id/BtnRegistrarSe"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginTop="44dp"
            android:background="#033f88"
            android:text="Registrar"
            android:textColor="#ffffff"
            android:textSize="18sp"
            android:layout_below="@+id/linearLayout"
            android:layout_centerHorizontal="true"
            />
    </LinearLayout>
</ScrollView>

Imagem

  • Jairo, I tested your code here and it’s working normally, try to illustrate your problem better.

  • So all the fields of the form are with validation, and present an error msg under Edit text that present some error, when this occurs it pushes the other components down, already put the property that already leaves that space that will be occupied by the error msg, so the button is out of the screen(In the emulator, or cell phone) not in pteview, p sure would be when I scroll the page this button appear, because it is inside the scrollview like all other components, but this does not occur is as if, simply scrolling ended before the Button.

No answers

Browser other questions tagged

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