たくさんの例や投稿を見てみましたが、どれも私の問題に一致しません。
1つの画面に表示できないように、多くの列を持つ非常に長い(水平の)テーブルを作成する必要があります。そして、このようにテーブルを表示することが重要なので、テーブルをこぼしたくありません。
以下にXMLレイアウトを貼り付けました(主な重要なものを含む)
コードを削除すると、次のようになります。
android:fillViewport="true"
ホリゾンタルスクロールビューから、その中の私のテーブルは、特にその左側で、1つの場所に押し込まれます。このHorizontalScrollViewコンテナ領域の多くを使用することすらありません。
そして、このコードを使用すると、このHorizontalScrollViewは、テーブル全体をその中に表示します。列は、このスクロールビューに収まるようにスクイーズされます。
このスクロールビューに、画面の幅に収まるテーブルレイアウトのコンテンツのみを表示させたいので、残りの列をスクロールできます。しかし、今のところ、私はどこにも近づいていないようです。
では、どうすれば問題を解決できますか?私は何か間違ったことをしていますか?
これが私のXMLレイアウトです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<HorizontalScrollView
android:id="@+id/horizontalScrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="horizontal"
android:fillViewport="true">
<TableLayout
android:id="@+id/bot_scoreBoard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/table_shape"
android:orientation="horizontal"
android:stretchColumns="*" >
<TableRow
android:layout_height="fill_parent"
android:layout_margin="2dp"
android:background="#ffffff"
>
<TextView
/>
....
more than 16 columns of made using TextView
....
</TableRow>
</TableLayout>
</HorizontalScrollView>
</LinearLayout>