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 an Interactive Story App User Input Using EditText for Text Input

Layout is different in an actual device

When I run my app in my actual device the result is different. My device resolution is 1080 x 1920.

actual device:

Imgur

layout:

Imgur

1 Answer

Hi. That's perfectly normal as the screen sizes and aspect ratios are different. If you want to run the app on an emulator that is more similar to your actual phone, you might want to select a Pixel 2 XL. The aspect ratio of the 2 phones is different: 16:9 for the Nexus 5 (your current emulator) and 18:9 for the Pixel 2 XL (closer to your phone's aspect ratio), which explains the larger "gap" between the image and the edit text on your actual phone.

Hope that helps :)

Hi hanks for the answer. What would I do so that it will look the same in any devices?