-2

<TableLayout>Android で垂直スクロールと水平スクロールを使用して 2 列を作成しようとしています。

このような:

分割画面スクロール

これは私のコードです:

<?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" >

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:weightSum="1.0" >

       <LinearLayout
           android:layout_width="match_parent"
           android:layout_height=".90"
           android:layout_gravity="left"
           android:layout_weight=".35" >

            <TextView
                android:id="@+id/TextView04"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#b0b0b0"
                android:text="column 1"
                android:textColor="#000000" />

        </LinearLayout> 

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_gravity="right"
            android:layout_weight=".65" > 

            <TextView
                android:id="@+id/TextView03"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="#a09f9f"
                android:text="column 2"
                android:textColor="#000000" />
        </LinearLayout>
    </TableRow>

</TableLayout>

多分誰かが私がすべてのコードを書くのを手伝ってくれるでしょうか?

4

1 に答える 1

0

Android -- 水平および垂直スクロールを許可する方法

したがって、4 つのスクロールビューが必要です。横2本、縦2本。

<LinearLayout>
<ScrollView>
<HorizontalScrollView >
Column1
</ScrollView>
</HorizontalScrollView >
<ScrollView>
<HorizontalScrollView >
Column2
</ScrollView>
</HorizontalScrollView >
</LinearLayout>

linearlayout は水平でなければなりません。

于 2012-08-03T15:35:05.033 に答える