Setzen Bildansicht auf dem unteren Rand des Bildschirms

Ich versuche, um die Bildansicht auf der Unterseite vom Lay-out mit den folgenden XML-Code:

        <?xml version="1.0" encoding="utf-8"?>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical"
            tools:context=".MainActivity" >
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:background="#EEEEEE"
                android:gravity="center"
                android:orientation="horizontal" >
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:src="@drawable/photo" />
            </LinearLayout>
        </LinearLayout>

Ich bin nach der Anleitung hier http://sandipchitale.blogspot.co.uk/2010/05/linearlayout-gravity-and-layoutgravity.html

Einzige Unterschied ist, dass ich die Bildansicht anstelle von Button, wie hier:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="center"
        android:orientation="horizontal" >
        <Button
            android:id="@+id/Button03"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:text="bottom" >
        </Button>
    </LinearLayout>
</LinearLayout>

Was bringt die Taste an der erwarteten Stelle:

Setzen Bildansicht auf dem unteren Rand des Bildschirms

Leider ist das nicht der Fall in meiner XML auf der Spitze der post. Die Bildansicht ist nicht platziert auf der Unterseite als die Schaltfläche in der Referenz XML ist.

Setzen Bildansicht auf dem unteren Rand des Bildschirms

Irgendwelche Ideen, warum das passiert ?

InformationsquelleAutor Matko | 2013-10-06
Schreibe einen Kommentar