tzlil eliyahu
tzlil eliyahu

Reputation: 39

layout on android studio preview doesn't look the same when running the app on the phone

im developing an android app on android studio, when i run my app the layout looks a bit different from the preview as well as on other phones, for example: the buttons are in different order (from right to left instead from left to right) or other changes similar to this. as well as on some phones the layout doesn't fit perfectly on the screen for example: the buttons on the sides of the screen appear to be cut out. how can i fix it so the app will look the same with every phone and not only some of them?

Upvotes: 1

Views: 2964

Answers (3)

Stephen Wallace
Stephen Wallace

Reputation: 1

Make sure you check if you have used the constraints on your components properly. Usually that's what makes the layout messy after running the app on your phone/emulator, even tho it looks perfect on your XML file.

Upvotes: 0

MorZa
MorZa

Reputation: 2325

About the buttons that appear to be cut out - make sure you use dp units instead of pixels. You can read more about it here: http://developer.android.com/guide/practices/screens_support.html

Upvotes: 0

e-shfiyut
e-shfiyut

Reputation: 3675

About the Right-to-left/ Left-to-right, you can choose the globe icon in the preview options bar frame and then choose Preview Right-to-Left Layout option. This will "fix" the buttons order in preview.

Upvotes: 2

Related Questions