Rechts ausrichten von text in android?

Ist es irgendetwas spezielles, das ich tun müssen, um text Rechtsbündig in einer <TableLayout>?

Das folgende einfache Beispiel scheint ausrichten text rechts Kanten auf die Mitte des Bildschirms, fast so, als wenn layout_span hatte keine Wirkung.

<TableLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        >
    <TableRow>
        <TextView
                android:text="Some text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_span="2"
                />
    </TableRow>
    <TableRow>
        <Button
                android:text="Button 1"
                android:layout_weight="50"/>
        <Button
                android:text="Button 2"
                android:layout_weight="50"/>
    </TableRow>
</TableLayout>

InformationsquelleAutor Stefan Kendall | 2011-04-19

Schreibe einen Kommentar