so for a school project, I’m making an app but I’m just stuck on the last point.
I predesigned a background for my app in photoshop and imported it into Android Studio.
In this background, I already put the buttons and my plan was to, in the android studio, just put the buttons on it and it’ll work.
The problem is that the buttons don’t align with the background when I launch the app.
I got two screenshots to show what I mean:
-
This is how it looks in Android Studio itself:
https://gyazo.com/05c818710de2db29b630beb8107577e2 -
This is what happens when I launch the app:
https://gyazo.com/2369f3b2c0154262620482b53e007729
Did anyone get any idea how to fix this?
Thanks in advance!
2
Answers
Your background screen will be display different as per the screen resolution of the different different android devices.
So as per my experience you should remove that buttons from the background and you have to set button’s background in your layout file as per your requirement.
You should group your buttons in LinearLayout with android:layout_gravity=”center” to keep it in center of layout, like so:
Also, adjust android:layout_marginTop to roughly match the background file