Mindesthöhe fill_parent und height wrap_content in ScrollView? (oder nur die E-Mail-App den Layout-Code zusammenstellen)

Frage Wenn ich die folgenden:

<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent">
    <LinearLayout android:layout_width="fill_parent" android:layout_height="?" android:orientation="vertical">
        <EditText android:layout_width="fill_parent" android:layout_height="?" android:hint="Subject" android:id="@+id/subject" />
        <EditText android:layout_width="fill_parent" android:layout_height="?" android:id="@+id/body" />
    </LinearLayout>
</ScrollView>

Wie bekomme ich den Körper (zweite EditText) zu füllen den rest des Bildschirms, aber immer noch die scrollview treten, wenn der Inhalt der Körper zu lang sind? Wie ein height="wrap_content" und minHeight="fill_parent"

layout_height="fill_parent" scheint nicht alles tun, wenn Sie in einem scrollview

Ein Beispiel von dem, was ich will, ist die E-Mail-app verfassen-Fenster

Habe ich versucht, dieses und die EditText-Elemente handeln, wie Sie sind wrap_content und keine Füllung geschieht. Einfach scrollen, wenn Sie geben genug

<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent">
    <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
        <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" layout_weight="1" android:hint="Subject" android:id="@+id/subject" />
        <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" layout_weight="1" android:id="@+id/body" />
    </LinearLayout>
</ScrollView>

InformationsquelleAutor der Frage George Bailey | 2010-10-07

Schreibe einen Kommentar