Abfrage zur Layoutausrichtung {Horizontal zentrieren + Vertikal zentrieren}

Muss sehr einfach zu lösen sein, aber ich bin nicht in der Lage, dies zu lösen.

Ich möchte "top image and log_in_box" ausrichten, damit das Ganze genau in der Mitte (horizontal + vertikal in der Mitte) des Bildschirms angezeigt wird.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent" android:orientation="vertical">

    <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"
        android:layout_gravity="center_vertical|center_horizontal">

        <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/ic_launcher"
            android:contentDescription="" />

        <LinearLayout android:id="@+id/log_in_box" android:layout_width="match_parent" android:layout_height="wrap_content"
            android:orientation="vertical">
            <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="User ID"
                android:inputType="text" />

            <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp"
                android:hint="Password" android:inputType="textPassword" />

            <CheckBox android:layout_width="match_parent" android:layout_height="wrap_content" android:checked="true"
                android:text="Remember Me" android:layout_marginTop="10dp" />

            <Button android:id="@+id/log_in" android:layout_width="match_parent" android:layout_height="wrap_content"
                android:layout_marginTop="10dp" android:text="Log In" />
        </LinearLayout>

    </LinearLayout>

</LinearLayout>

Aktueller Look

Antworten auf die Frage(3)

Ihre Antwort auf die Frage