Android Build a Simple Android App Creating the Screen Layout Adding a Button

Andrew Minert
Andrew Minert
3,984 Points

The text and button are appearing on top of each other when I run the app, even though in the design screen show dif..

The text and button are appearing on top of each other when I run the app, even though in the design screen show different. They overlay each other on the upper left hand side the screen. Does anyone have any suggestions on how to correct this. Using Android Studio as directed by the video.

5 Answers

Henrik Jacobsson
Henrik Jacobsson
218 Points

Hi

In the Design view, above the phone/tablet window there is a few icons.

From the right: An eye (Hide constraints) A magnet(Turn of autoconnect) etc...

Press the 4th one. (Infer constraints). Run your program.

It worked for me.

Michael LaCroix
Michael LaCroix
5,828 Points

Thank you!! I was getting so frustrated by this.

Andrique Liu
Andrique Liu
868 Points

Worked for me as well!

Amulya Arora
Amulya Arora
5,798 Points

Thank you ! It worked for me as well..

Charles Webb
Charles Webb
1,542 Points

Why does this work? can someone explain what 'infer constraints' does, exactly?

Charles Webb
Charles Webb
1,542 Points

Looks to me like it properly configures the constraint layout according to some default action. This tutorial was made before the constraint layout existed so that would explain it.