1
I’m learning to create android apps, but face appears an error when I test the app on mobile, and text is on top of each other, or any object I add.
in Android studio is like this:
xml:
<?xml version="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>
This is no mistake. You’re not implementing constraints in views. I suggest you take a look at how to use Constraintlayouts. This is a good place: https://codelabs.developers.google.com/codelabs/constraint-layout/
– Márcio Oliveira
Um, thanks for the help I’ll study more about this.
– Caymmi
Or change the Constraint to relativelayout
– Oto Campos