Elements stacked Android Studio


I'm starting in Android Studio (2.3), I made a program with 4 elements (sum of numbers) but at the time of executing it, the elements appear on the top left and I can not manipulate the program, what should it be?


asked by Edav 24.03.2017 в 02:54

3 answers


You have support enabled for ConstraintLayout , and you are using as your primary layout a < a href="https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html"> ConstraintLayout , your views are showing at the 0,0 coordinates surely.

Define restrictions on your views so that they appear in the correct position when your application is running :

I did not find a tutorial in Spanish, but I add the one in the documentation:


If you do not want to use ConstraintLayout , simply change in your .xml layout, from:


to another layout type for example LinearLayout :


or RelativeLayout :

answered by 24.03.2017 в 18:39

When you are creating applications in android studio, the latest versions come with this default option for responsive interfaces with android:



which can be deleted from the layout xml in addition to removing it from the gradle.

Then in the XML you change it by:



From there, you can locate your view anywhere in the RelativeLayout using


android: layout_alignParentTop,   android: layout_centerVertical, among other options

or if you want to also place it next to another view you can also add


android: layout_toRightOf and others like that

here I leave you from the android developers all about it. enter the description of the link here

answered by 27.11.2017 в 23:37

I had the same error and it was because of a dependence on the file

AppAndroid \ app \ build.gradle

I changed the

implementation 'com.android.support:appcompat-v7:28.0.0-rc02'


implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
answered by 08.09.2018 в 01:42