So ändern Sie das layout mit minimaler Höhe im android-Programmierung?

In der android-Programmierung, wie ändern Sie das layout der Höhe das kleinste kann es so sein, dass alle Elemente noch zeigen, bis auf es.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textview_username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+string/email" />

    <EditText
        android:id="@+id/textinput_username"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textEmailAddress" />

    <TextView
        android:id="@+id/textview_password"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+string/password" />

    <EditText
        android:id="@+id/textinput_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPassword" />

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >
        <Button
            android:id="@+id/button_exit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@+string/cancel" />

        <Button
            android:id="@+id/button_login"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@+string/ok" />
    </LinearLayout>

</LinearLayout>

Dies ist mein code, und wenn ich diesen starte, es gibt eine Menge der weißen Raum zeigen. Dieses layout zeigt nur in Dialogfeldern.

Dank.

EDIT:

Bekam ich die Höhe minimiert werden, aber die Schaltfläche " OK "nun erscheint rechts neben der Schaltfläche "Abbrechen". Ich will, dass es rechts ausgerichtet wird.

InformationsquelleAutor omega | 2013-07-07
Schreibe einen Kommentar