Ich habe einen Button im linearen Layout, wenn ich in der Design-Ansicht von Activity XML sehe, sieht es aus wie es perfekt positioniert ist, aber wenn ich in GenyMotoin avd sehe, ist es weit von dem, was ich platziert erwartet. Wie kann die Position der Taste auf verschiedenen Bildschirmgrößen dynamisch angepasst werden?Dynamisch Position von Button in Android Studio anpassen
Meine XML-Datei:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.xxx.MainScreen"
android:background="#b6b6b6">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:layout_width="match_parent"
android:layout_height="263dp"
android:id="@+id/textView"
android:textSize="50dp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="264dp">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next Act"
android:id="@+id/button"
android:layout_marginTop="100dp"
android:layout_marginLeft="20dp" />
</LinearLayout>
</RelativeLayout>
und Ihre Fragen sind? – aditya
1. Bitte seien Sie speziell auf Ihr Problem. 2. Veröffentlichen Sie Ihre XML-Datei. 3. Was möchten Sie erreichen und was bekommen Sie jetzt? – Kunu
was hast du bis jetzt gemacht? –