First of all I'm quite new in layout development so sorry if this is a noob question. I'm trying to create an xml with a sort of an interactive background. So I put a background picture and added some ImageButtons with pictures like part of the background layout (to make them invisible).
Everything works as expected but the position of these ImageButtons change from the editor on the base of the device where the app is installed (or the AVD device too). I'm using a constraintlayout. At the moment, my ImageButtons xml is:
<ImageButton
android:id="@+id/IB1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="83dp"
android:layout_marginTop="14dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:src="@drawable/IB1"
android:scaleType="fitCenter"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
I understand that this happen because the background picture is resized on the base of the device screen where the app run (and this is in general correct because I want that the background cover all the layout space even if in portrait mode the picture is clearly very bad rendered; think to a tree, when you rotate the phone it is compressed on the vertical side and expanded on the horizontal side).
Exist a way to do what I want? Maybe with another type of layout or with some properties?
Thanks a lot for the help!