I am trying put a button in my android activity. I am creating it with xamarin.android and (not xamarin.forms) and I cant seem to position the button where I like.
My code for button looks like this which allows me to put the button where I want.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal">
<AbsoluteLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frameLayout1">
<ImageView
android:id="@+id/myImage"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:src="@drawable/my_image" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gotologin"
android:layout_x="125px"
android:layout_y="482px" />
</AbsoluteLayout>
</RelativeLayout>
However, when I change the screen size to another emulator, the position changes. I am obviously doing something wrong but I cant seem to find a way to keep the size and position of the button same for all screen size.
Please, can anyone point me to right direction of the part of the documentation i need to read to do this? Thanks.
Screenshot
Note the button position changed.