AndroidStudio:ScrollView can host only one direct child,エラーメモ

ScrollViewではScrollViewの下に一つの要素しかおけない。
こういうのとかやるとでてくる。

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</ScrollView>

だから下の奴みたいにLinearLayoutとか挟む。

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA