I'm strugling while creating designs for Android. According to some information that I've found, an MDPI screen has a 1 scale factor, So I create an image of 48dp = 48px and save it in the mdpi folder and then with the correct scaling factor, I'm saving it across the various places.
Now, I want to have a button that's the same height as my image, off course, in my layout I can declare a button of 48dp height, but then, when being used on other screens (say XXHDPI) the image and the button are not the same in height anymore.
Edit: Added the layout of the button
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp">
<Button
android:id="@+id/btnCamera"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/logon_camera_button"
android:text="@string/logon_scanQrCode"
android:textColor="#ffffff"
android:textSize="20sp"
android:layout_marginLeft="48dp"
android:layout_marginRight="25dp"
android:gravity="center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/btnCamera"
android:layout_alignLeft="@+id/btnCamera"
android:id="@+id/imgCamera"
android:src="@drawable/camera" />
</RelativeLayout>
Anyone who has some advice on this topic?
Kind regards