Ich entwickle meine erste android App und benutze Xamarin. Alles andere funktioniert gut, aber wenn ich aufgrund der Änderung der Auflösung zwischen verschiedenen Geräten umschalte, ändert sich die Position und Größe meiner UI-Elemente. Nachstehend ist der Main.xml-Code, den ich verwende.Wie kann man die Änderung der Position und Größe des UI-Elements mit der Änderung der Auflösung in Android vermeiden?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/avsar_ui"
android:weightSum="100"
android:minWidth="200px"
android:minHeight="200px"
android:id="@+id/linearLayout1">
<EditText
android:text="name"
android:textColor="?android:attr/searchWidgetCorpusItemBackground"
android:inputType="textPersonName"
android:layout_marginTop="225.0dp"
android:layout_marginBottom="25.0dp"
android:layout_width="match_parent"
android:background="@drawable/rounded_corner"
android:layout_marginLeft="50.0dp"
android:layout_marginRight="50.0dp"
android:layout_height="wrap_content"
android:id="@+id/PersonName" />
<EditText
android:text="Contact Number"
android:textColor="?android:attr/searchWidgetCorpusItemBackground"
android:inputType="numberSigned"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner"
android:layout_marginLeft="50.0dp"
android:layout_marginBottom="10.0dp"
android:layout_marginRight="50.0dp"
android:id="@+id/ContactNumber" />
<EditText
android:text="Address"
android:textColor="?android:attr/searchWidgetCorpusItemBackground"
android:inputType="textPostalAddress"
android:layout_width="match_parent"
android:background="@drawable/rounded_corner"
android:layout_marginLeft="50.0dp"
android:layout_marginRight="50.0dp"
android:layout_marginBottom="10.0dp"
android:layout_height="wrap_content"
android:id="@+id/Address" />
<Spinner
android:layout_width="125.0dp"
android:background="@drawable/dropbox_bg"
android:layout_marginLeft="50.0dp"
android:layout_height="40.0dp"
android:id="@+id/Quantity" />
<Button
android:background="@drawable/order_button"
android:layout_marginBottom="60dp"
android:layout_marginTop="100dp"
android:layout_marginLeft="115.0dp"
android:layout_marginRight="115.0dp"
android:layout_width="150.0dp"
android:layout_height="50.0dp"
android:id="@+id/OrderButton" />
</LinearLayout>
geändert px zu dp dint help –