Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.