use
android:layout_x=”xxdp“
android:layout_y=”xxdp“
Specify the coordinates. Because there are too many Android models with different screen sizes and resolutions, some models may not be fully displayed, so it is deprecated.
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="@drawable/ic_launcher_foreground"
android:foregroundGravity="right|bottom">
<ImageView
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_x="500dp"
android:layout_y="500dp"
android:background="#00ff00"/>
</AbsoluteLayout>