AppBar overlapping the contents of the rest of the Activity

0

I'm doing some exercise but at the time of running, the bar always stays on top of the Activity content.

Print how are you for now

Belowismyfilecontent_formulario.xml:

<?xmlversion="1.0" encoding="utf-8"?>
<ScrollView
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

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

        <EditText
            android:hint="Nome"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <EditText
            android:hint="Endereço"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <EditText
            android:hint="Telefone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <EditText
            android:hint="Site"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <RatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:numStars="5"
            android:max="10"
            android:layout_gravity="center"/>

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Salvar"/>

    </LinearLayout>
</ScrollView>

Does anyone know how I can solve this? Thank you.

    
asked by anonymous 19.10.2015 / 18:55

1 answer

0

Try this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="1dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical">
<ScrollView
    android:layout_height="match_parent"
    android:layout_width="match_parent">

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

        <EditText
            android:hint="Nome"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <EditText
            android:hint="Endereço"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <EditText
            android:hint="Telefone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <EditText
            android:hint="Site"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <RatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:numStars="5"
            android:max="10"
            android:layout_gravity="center"/>

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Salvar"/>

    </LinearLayout>
</ScrollView>
</LinearLayout>

We need to add Layout to behave the screen components.

    
19.10.2015 / 19:13