60

ここの XML コードを見てください。

<TableLayout
    android:id="@+id/tableLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dip"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <TableRow
    android:id="@+id/tableRow1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <!-- Some stuff goes here -->

    />
    </TableRow>

    <TableRow
    android:id="@+id/tableRow2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <!-- Some stuff goes here -->

    />
    </TableRow>

    <TableRow
    android:id="@+id/tableRow3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <!-- Some stuff goes here -->

    />
    </TableRow>


</TableLayout>

私のコードはそれよりもはるかに長いですが、不要な部分を削除しただけです。問題は、これTableLayoutをスクロール可能にして、すべてのものを表示できるようにすることです。

TableLayoutスクロール可能にするために、この行を入れようとしました:

android:isScrollContainer="true"

しかし、それは仕事をしません。方法はありますか?

4

4 に答える 4

106

全体を次のように入れます。

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="none"
    android:layout_weight="1">
    <LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical">

    ...

</ScrollView>
于 2011-06-28T22:19:19.220 に答える