Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
6,133 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.