0

TableLayout 内に TableRow があります。TableRow に垂直方向の ScrollView を配置すると、期待どおりに動作します。ただし、TableRow に Horizo​​ntalScrollView を配置すると、スクロールはまったく機能しません。

なぜこれが起こるのか誰か知っていますか?それを達成するために回避策を使用できますか?

前もって感謝します!

- 編集 -

次に例を示します。

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TableRow>
        <HorizontalScrollView android:scrollbars="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent">

                <TableRow>
                    <Button android:layout_width="350px" android:layout_height="350px" android:text="TEST" />
                    <Button android:layout_width="350px" android:layout_height="350px" android:text="TEST" />
                </TableRow>
                <TableRow>
                    <Button android:layout_width="350px" android:layout_height="350px" android:text="TEST" />
                    <Button android:layout_width="350px" android:layout_height="350px" android:text="TEST" />
                </TableRow>
            </TableLayout>

        </HorizontalScrollView>

    </TableRow>

</TableLayout>

Horizo​​ntalScrollView を垂直 ScrollView に変更すると、(明らかに垂直に) 機能します。

4

1 に答える 1

0

試す

<HorizontalScrollView android:scrollbars="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent">

編集:

これにより、ScrollView が、親で使用可能な場所のサイズではなく、コンテンツのサイズ (コンテンツ サイズ) に設定されます。

于 2014-08-20T15:42:57.267 に答える