Rechtsbündig Spalte in android table layout
Ich will eine Tabelle zeichnen, in der letzten Spalte auf der rechten Seite der Tabelle.
Dies ist, wie die Zeile in der Tabelle sieht wie folgt aus:
Admin (2)New
Network (2)New
Und das ist, wie es sein sollte:
Admin (2) New
Network (2) New
XML:
<?xml version="1.0" encoding="utf-8"?>
<!-- row.xml -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="45dp"
android:gravity="center" android:background="@color/list_bg">
<TableLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow>
<ImageView android:id="@+id/t1" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:id="@+id/t2" android:typeface="normal"
android:singleLine="true" android:textSize="14sp" android:textStyle="normal"
android:layout_width="wrap_content" android:textColor="#000000"
android:layout_height="wrap_content" />
<TextView android:id="@+id/t10" android:typeface="normal"
android:singleLine="true" android:text=" " android:textSize="14sp"
android:textStyle="normal" android:layout_width="wrap_content"
android:textColor="#000000" android:layout_height="wrap_content" />
<TextView android:id="@+id/t4" android:typeface="normal"
android:visibility="gone" android:singleLine="true" android:text="("
android:textSize="14sp" android:textStyle="normal"
android:layout_width="wrap_content" android:textColor="#000000"
android:layout_height="wrap_content" />
<TextView android:id="@+id/t5" android:typeface="normal"
android:visibility="gone" android:singleLine="true"
android:textSize="14sp" android:textStyle="normal"
android:layout_width="wrap_content" android:textColor="#000000"
android:layout_height="wrap_content" />
<TextView android:id="@+id/t6" android:typeface="normal"
android:visibility="gone" android:singleLine="true" android:text=")"
android:textSize="14sp" android:textStyle="normal"
android:layout_width="wrap_content" android:textColor="#000000"
android:layout_height="wrap_content" />
<ImageView android:id="@+id/t3" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:id="@+id/t7" android:typeface="normal"
android:visibility="visible" android:singleLine="true" android:text="New"
android:textSize="14sp"
android:textStyle="normal" android:layout_width="wrap_content"
android:textColor="#000000" android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
</RelativeLayout>
In diesem xml-t7 sollte direkt an der rechten Seite der Tabelle, wie dies zu tun???
InformationsquelleAutor der Frage Ankit HTech | 2012-10-15
Du musst angemeldet sein, um einen Kommentar abzugeben.
Hier haben Sie zu tun
legen Sie die Tabelle, Zeile, Breite
fill_parent
und legen Sie die
android:layout_gravity="right"
auf die textview, die Sie ausrichten wollen Recht es zu der Zeile in der Tabelle- - - - - oder - - - - -
InformationsquelleAutor der Antwort Ram kiran
Beispiel (pseudo-code):
InformationsquelleAutor der Antwort Cookster