problem of objects on top of each other in Android Studio

0

I'm learning to create android apps, but face-to-face I get an error when I test the app on my phone, and text gets on top of the other, or any object I add.

inAndroidstudiolookslikethis:

xml:

<?xmlversion="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="meuprimeiroapp.studio.com.meuprimeiroapp.MainActivity">

    <TextView
        android:id="@+id/txtLogin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Login:"
        android:textColor="#000"
        android:textSize="40sp"
        android:textStyle="bold"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="103dp" />

    <TextView
        android:id="@+id/txtPass"
        android:layout_width="127dp"
        android:layout_height="53dp"
        android:text="Senha:"
        android:textColor="#000"
        android:textSize="40sp"
        android:textStyle="bold"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="16dp" />

    <EditText
        android:id="@+id/editText2"
        android:layout_width="460dp"
        android:layout_height="55dp"
        android:ems="10"
        android:inputType="textEmailAddress"
        tools:layout_editor_absoluteX="136dp"
        tools:layout_editor_absoluteY="16dp" />

    <EditText
        android:id="@+id/editText4"
        android:layout_width="460dp"
        android:layout_height="48dp"
        android:ems="10"
        android:inputType="textPassword"
        tools:layout_editor_absoluteX="136dp"
        tools:layout_editor_absoluteY="98dp" />
</android.support.constraint.ConstraintLayout>
    
asked by anonymous 04.09.2017 / 23:33

2 answers

1

You are using ConstraintLayout, and it works in a different way ...

For you, which is starting now, use LinearLayout as the root layout, and then put some other LinearLayout inside this root, to allocate the content

    
06.09.2017 / 02:09
1

In Android Studio, Constraint Layout is coming by default, change the layout, or adapt to Constraint. To use Constraint Layout you can use a tool that automatically adjusts the items.

Ordothismanually,whichisbetter,asyoudoyourwill.

    
07.01.2018 / 16:26