I'm new in Android, i just create my first simple app on android studio, but constraints layout doesn't work correctly on real phone or virtual phone. I intent to put a button on the center of layout, and an edit text at top of layout, but when i run, both of it located same position at right-top layout, so i can't type a text and press the button.
I try to use RelativeLayout and it worked, so i guess the problem come from ConstraintLayout. Please help me fix it!
I have already install"ConstraintsLayout For Android 1.0.1 or lower", and "Solver For ConstraintsLayout 1.0.1 or lower". In build.gradle have added compile 'com.android.support.constraint:constraint-layout:1.0.1'
I use Android Studio version 2.3.
And here is my xml code:
<?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="my.android.myfirstapp.MainActivity">
<Button
android:id="@+id/btn_jump"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Jump Activity"
tools:layout_editor_absoluteX="128dp"
tools:layout_editor_absoluteY="269dp" />
<EditText
android:id="@+id/edt_Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text=""
tools:layout_editor_absoluteX="85dp"
tools:layout_editor_absoluteY="62dp" />
</android.support.constraint.ConstraintLayout>