Hook objects in Android Studio

1

You will see, in Android Studio when I create a new object, it is not anchored to the mobile screen and I must do it manually on all 4 sides to make sure it is in a fixed position.

In the image I show 2 TextView objects. One anchored to the screen, which appears just after creating the project. The other one is not.

And this is what happens when you run it.

Is there a way to make when creating an object that is already anchored, or at least to connect it to the screen quickly?

Edit: A way to anchor an object more quickly is by clicking on the 4 anchor buttons shown in the attributes.

Strangely, although I try it and it works perfectly, it seems that the connections are somewhat unstable, and each connection can be of different types.

I add: When I connect the objects, instead of doing it in the layout, they are likely to want to engage others, which will make it difficult to position the objects because they can also change their position. Apart from that if you hook one object to another, when trying to move one, the other also moves.

    
asked by Miguel Alparez 20.12.2017 в 22:17
source

1 answer

-1

In this case both elements must have restrictions, otherwise although in the design view you see them in the correct position, any element that has no defined restrictions will be shown in the position 0,0:

Error showing an Activity, elements stacked position 0.0

You have to define the restriction if you are using ConstraintLayout .

    
answered by 20.12.2017 в 22:20