Layout issue: buttons move from designed position

Dowell Griffin

New member
Dec 18, 2020
1
0
0
This is the first time I am trying: background image covers entire screen except status bar. (nice layout delivered to me)

I am placing invisible buttons over the image to add functionality.

When in design view or layout validator things are in position I want.

However when I run the emulator or deploy to device the buttons shift further down than designed. It seems buttons/items further down the page are shifted more than those at the top (maybe a clue). Seems like a scaling issue but since new to me need a hint. I have the layout designer set to the proper device. I have starting orientation as portrait.

I tried RelativeLayout and ConstraintLayout (same behavior)
I tried placing background image as ImageView with match-parent AND also as android:background on the layout element. (similar behavior but see slight difference in amount of shift).

I am fragments and using the following attributes for all buttons (relative to the layout element/the container)
app:layout_constraintStart_toStartOf="@+id/main_fragment"
app:layout_constraintTop_toTopOf="@+id/main_fragment" />

The source file for the background image is not 1024x600 so guess one can say it is being stretched to fit. (not sure how this matters)

Regardless: I need to understand why what I design is not what I get?????

All I want is a fixed screen where nothing ever moves or resizes. I have specific target device 1024x600 mdpi tablet. This seems to be the same as the generic 7" WSVGA tablet in android studio. I tired that and a custom 1024x600 device.

The table specs are: 1024x600 pixels 160dpi (mdpi)

What am I doing wrong? Where is there a tutorial or other help related to this?

THANK YOU!