これは意味がありません。私はシンプルなLinearLayoutを持ついくつかのコードを持っているし、そこにTextViewとScrollViewがあり、ScrollViewの中にボタンがあります。私が2番目のボタンを追加すると、ScrollViewには1つの子しかないというエラーが表示されます。ボタンは別の子と見なされますか?これが本当にシンプルなのであれば、私の愚かさには申し訳なく思っています。誰でも感謝を助けることができれば!誰かがこのScrollViewに余分なボタンを追加できない理由を説明できますか?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:duplicateParentState="false"
android:fadeScrollbars="true"
android:gravity="center"
android:isScrollContainer="true"
android:orientation="vertical"
android:scrollbars="vertical">
<TextView
android:text="Select category:"
android:textStyle="italic"
android:textColor="#000000"
android:textSize="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ScrollView
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadingEdgeLength="100dp">
<Button
android:id="@+id/Food"
android:layout_width="175dp"
android:layout_height="65dp"
android:layout_gravity="center"
android:gravity="center"
android:background="@drawable/blackbutton"
android:text="Food"
android:textColor="#ffffff" />
<Button
android:id="@+id/Clothing"
android:layout_width="175dp"
android:layout_height="65dp"
android:layout_gravity="center"
android:gravity="center"
android:background="@drawable/blackbutton"
android:text="Clothing"
android:textColor="#ffffff" />
</ScrollView>
</LinearLayout>
2 'Button'は2つの子です –