-1

このレイアウトにスクロールビューレイアウトを追加しようとしています:

忙しい猫

I'm getting this error.

ScrollView can host only one direct child

How can I solve this problem?

4

2 に答える 2

3

scrollView は、彼の中に複数の子を含めることはできません

違う

<ScrollView>
   <LinearLayout>
       xxxxx
   </LinearLayout>
   <LinearLayout>
       xxxxx
   </LinearLayout>
<ScrollView>

<ScrollView>
  <LinearLayout>
   <LinearLayout>
       xxxxx
   </LinearLayout>
   <LinearLayout>
       xxxxx
   </LinearLayout>
  </LinearLayout>
<ScrollView>

直系の子は一人だけ。

于 2013-01-14T13:30:20.153 に答える
2

ScrollView 内に追加できるビューは 1 つだけです。したがって、 ScrollView 内に L1 などの LinearLayout を追加し、その LinearLayout(L1) 内に、他のすべての Views を追加します。

于 2013-01-14T13:29:46.880 に答える