2011-07-26 11 views
0
<ScrollView android:layout_width="fill_parent" 
    android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"> 
    <HorizontalScrollView android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

     <TableLayout android:id="@+id/test_table" 
      android:layout_width="match_parent" android:layout_height="fill_parent" 
      android:orientation="horizontal"> 

      <TableRow android:id="@+id/column_01" android:layout_height="wrap_content" 
       android:orientation="vertical"> 
       <TextView android:id="@+id/column_01_header" 
        android:layout_height="match_parent" android:layout_width="wrap_content" 
        android:text="Column 01 Header" /> 
      </TableRow> 

      <TableRow android:id="@+id/column_02" android:layout_height="wrap_content" 
       android:orientation="vertical"> 
       <TextView android:id="@+id/column_02_header" 
        android:layout_height="match_parent" android:layout_width="wrap_content" 
        android:text="Column 02 Header" /> 
      </TableRow> 

     </TableLayout> 
    </HorizontalScrollView> 
</ScrollView> 

は出力がTableLayoutオリエンテーション問題

Column Header 01 
Column Header 02 

(垂直)である。しかし、私はTableLayoutを使用する根拠は何か(水平)

Column Header 01 Column Header 02 
+0

第二のTextView(column_02_header)を追加でvertical.Put 2です。 –

答えて

0

のような出力をしたいですか?あなたは、あなたが望むものを得るために、同じTabelRowにTextViewを両方持っている必要があります。異なる行は、互いに上下に整列される。

+0

TableLayoutレベルの属性orientation = "horizo​​ntal"は、TableRowを水平方向に配置する必要があります。ではない? – dira

+0

これは正しくありません。TableLayoutはその属性を親LinearLayoutから借りていません。 – PravinCG

0

あなたは別のrow.Soに行と列のヘッダー02に列のヘッダー01を入れているが、明らかにそれは同じテーブルの行の行

+0

TableLayoutレベルの属性orientation = "horizo​​ntal"は、水平方向にbotRowを置く必要があります。ではない? – dira

+0

身長/体重の属性と関連がありますか? – dira

+0

あなたの最初のコメントについては、いいえ?行は行を意味します。異なる列をとる行にビューを配置すると、2番目の列では高さ、重さを変更できますが、それは異なり、2列 – Rasel