Ich verwende Tablelayout (android) zur Erstellung von Tabellen mit 5 Spalten Ich brauche Spalte innerhalb Tabelle zu überbrücken, kann aber nicht mit Layout-Spanne richtig Tabelle zu werden wie folgt aus:Layout-Span - Tabellenlayout android
|column 1 | column 2 | column 3 | column 4 | column 5 | |column 11 | column 22 | column 33 |
mein Code:
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="column 1"
android:id="@+id/q5"
android:layout_column="0"
android:textSize="12sp"
android:layout_gravity="center"
android:layout_weight="1"
android:textAlignment="center"
android:background="@drawable/s" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="column 2"
android:id="@+id/q4"
android:textSize="12sp"
android:layout_gravity="center"
android:layout_weight="1"
android:textAlignment="center"
android:background="@drawable/s" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="column 3"
android:id="@+id/q3"
android:textSize="12sp"
android:layout_columnWeight="1"
android:layout_gravity="center"
android:layout_weight="1"
android:textAlignment="center"
android:background="@drawable/s" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="column 4"
android:id="@+id/q2"
android:textSize="12sp"
android:layout_gravity="center"
android:layout_weight="1"
android:textAlignment="center"
android:background="@drawable/s" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="column 5"
android:id="@+id/q1"
android:textSize="12sp"
android:layout_weight="1"
android:layout_gravity="center"
android:textAlignment="center"
android:background="@drawable/s" />
</TableRow>
<TableRow>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="column 11"
android:id="@+id/textView10"
android:textSize="16sp"
android:layout_gravity="center"
android:layout_weight="1"
android:textAlignment="center"
android:background="@drawable/s" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="column 22"
android:layout_span="3"
android:id="@+id/textView12"
android:textSize="16sp"
android:layout_gravity="center"
android:textAlignment="center"
android:layout_weight="1"
android:background="@drawable/s" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="column 33"
android:id="@+id/textView11"
android:textSize="16sp"
android:layout_gravity="center"
android:layout_weight="1"
android:textAlignment="center"
android:background="@drawable/s" />
</TableRow>
ein Problem ist: Spalte 11 und Spalte 33 ist die Breite ändern, so ein Layout-Design ist schlecht .. bitte helfen Sie mir, was kann ich tun?
Danke .. es ist Arbeit, aber ich brauche erste und letzte Spalte für die zweite Reihe hat die gleiche Breite wie Faust und letzte Spalte für die erste Reihe! .. danke nochmal – Kholoud
Ok hab es. Bitte versuche meine bearbeitete Antwort. Es wird funktionieren. – sanjay
Danke für Ihre Hilfe – Kholoud