B
baeckerman83
Neues Mitglied
- 0
Hiho!
Ich einige Daten, die ich übersichtlich auf einer Activity an ordnern will. Aber irgendwie klappt das nicht wie ich das möchte. Bis jetzt nutze ich ein Tablelayout, vielleicht ist das aber auch einfach das falsche.
Ich habe:
1. Tabelle
1. Zeile: 2 Spalten
2. Tabelle
1. Zeile: 1 Spalte
2. Zeile: 4 Spalten
3. Zeile: 1 Spalte
4. Zeile: 4 Spalten
bei den 4 Spalten handelt es sich um eine TextView, ImageView, TextView, ImageView.
Also ich nur die TextView hatte habe ich diese per Gravity Center angeordnet und dann war auch alles immer schön mittig, aber jetzt mit der Imageview bekomme ich es nicht mehr schon zentriert hin.
Anbei mal ein Bild wie es aussehen soll. Ist das das Tabellyout das richtige für?
und hier noch mein Quellcode, ich denke mal durchschauen muss man ihn nicht unbedingt um mir zuhelfen.
Ich einige Daten, die ich übersichtlich auf einer Activity an ordnern will. Aber irgendwie klappt das nicht wie ich das möchte. Bis jetzt nutze ich ein Tablelayout, vielleicht ist das aber auch einfach das falsche.
Ich habe:
1. Tabelle
1. Zeile: 2 Spalten
2. Tabelle
1. Zeile: 1 Spalte
2. Zeile: 4 Spalten
3. Zeile: 1 Spalte
4. Zeile: 4 Spalten
bei den 4 Spalten handelt es sich um eine TextView, ImageView, TextView, ImageView.
Also ich nur die TextView hatte habe ich diese per Gravity Center angeordnet und dann war auch alles immer schön mittig, aber jetzt mit der Imageview bekomme ich es nicht mehr schon zentriert hin.
Anbei mal ein Bild wie es aussehen soll. Ist das das Tabellyout das richtige für?
und hier noch mein Quellcode, ich denke mal durchschauen muss man ihn nicht unbedingt um mir zuhelfen.
Code:
<TableLayout
android:stretchColumns="0,1"
android:layout_height="wrap_content"
android:id="@+id/tableLayout1"
android:layout_width="fill_parent">
<TableRow android:layout_gravity="center"
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_gravity="center" android:text="" android:id="@+id/heim_m" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:text="" android:layout_height="wrap_content" android:layout_gravity="center" android:id="@+id/gast_m"></TextView>
</TableRow>
</TableLayout>
<ScrollView android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:stretchColumns="0,2"
android:layout_height="wrap_content"
android:id="@+id/tableLayout2"
android:layout_width="fill_parent">
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_gravity="center"
android:layout_span="4"
android:layout_width="wrap_content"
android:text="@string/table"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content"
android:id="@+id/textView1"></TextView>
</TableRow>
<TableRow
android:id="@+id/row_tabellenplatz"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_gravity="center"
android:text="" android:id="@+id/tv_tabellenplatz_h"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<ImageView
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/iv_tabellenplatz_h"></ImageView>
<TextView android:layout_gravity="center"
android:text=""
android:id="@+id/tv_tabellenplatz_g"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<ImageView
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/iv_tabellenplatz_g"></ImageView>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_gravity="center"
android:layout_span="4"
android:layout_width="wrap_content"
android:text="@string/table_h_g"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content"
android:id="@+id/textView1"></TextView>
</TableRow>
<TableRow android:id="@+id/row_tabellenplatz_h_g" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:layout_gravity="center" android:text="" android:id="@+id/tv_tabellenplatz_heim_h" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:layout_gravity="center" android:text="" android:id="@+id/tv_tabellenplatz_gast_g" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</TableRow>
<TableRow android:id="@+id/row_trend" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:layout_gravity="center" android:text="" android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:layout_gravity="center" android:text="" android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</TableRow>
<TableRow android:id="@+id/tableRow6" android:layout_width="wrap_content" android:layout_height="wrap_content"></TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>