2010-12-28 6 views
0

Ich möchte 3-4 Tabellen in einem einzigen Bildschirm verwenden, aber sie können nicht auf dem gesamten Bildschirm neben "fill_parent" passen. es kommt nur auf die Größe des Textes nur in dieser Tabelle an. Kann mir jemand helfen? Ich habe folgenden Code verwendet.Wie verwendet man verschiedene Tabellen in UI, die entsprechend auf die volle Bildschirmgröße zugreifen?

<TableLayout android:orientation="vertical" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:stretchColumns="0" 
       android:id="@+id/Table1" 
       > 

      <TextView android:layout_height="fill_parent" 
         android:id="@+id/TextView01" 
         android:background="#00bfff" 
         android:text="@string/hello" 
         android:layout_width="fill_parent"> 

      </TextView> 
</TableLayout> 

<TableLayout android:orientation="vertical" 
       android:layout_width="wrap_content" 
       android:layout_height="fill_parent" 
       android:stretchColumns="0" 
       android:layout_below="@id/Table1" 
       android:id="@+id/Table2" 
       > 

      <TextView android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:id="@+id/TextView2" 
         android:background="#f4a460" 
         android:text="Text2" > 
      </TextView> 
</TableLayout>  

<TableLayout android:orientation="vertical" 
       android:layout_width="wrap_content" 
       android:layout_height="fill_parent" 
       android:stretchColumns="0" 
       android:id="@+id/Table3" 
       android:layout_below="@id/Table1" 
       android:layout_toRightOf="@id/Table2" 
       > 

      <TextView android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:id="@+id/TextView2" 
         android:background="#b03060" 
         android:text="Text3" > 
      </TextView> 
</TableLayout> 

Code eingeben hier

Antwort

0

In table2 und Table3 die

android:layout_width="wrap_content" 

zu

android:layout_width="fill_parent" 
ändern
+0

nicht arbeitender Mann .... ging schon durch all diese kleinen Änderungen – ruturaj

Verwandte Themen