0

私の頭は少し混乱しています...次の XML では、LinearLayout/TextView が ScrollView と同じサイズであることが期待されます。含まれている画像からわかるように、これは当てはまりません。

ここで何が起こっているのですか?LinearLayout が ScrollView と同じサイズでないのはなぜですか?

<ScrollView
    android:id="@+id/scrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#008B8B" >

    <LinearLayout
        android:id="@+id/contentLayout"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#DC143C" >

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="hello" />
    </LinearLayout>

</ScrollView>

ここに画像の説明を入力

4

1 に答える 1

1

使用する

android:fillViewport="true"

あなたのScrollView

于 2012-11-30T17:22:37.683 に答える