I'm very new at coding, I'm in Android Basics at Udacity. I have a constraint layout with various TextViews and ImageViews and need to add a scroll bar for an assignment. I tried adding the scrollview outside of the layout, that made the app crash, then in the layout with the other views as children of the scrollview within the constraint layout, but an error came up stating that there can be only one child for the scroll view. Why is that? How do I add a scrollview?
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="Hello World"
android:textSize="25sp"
android:textColor="#990099" />
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="Words"
android:textSize="25sp"
android:textColor="#990099"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="Words"
android:textSize="25sp"
android:textColor="#990099"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="Words"
android:textSize="25sp"
android:textColor="#990099"/>
</ScrollView>
</LinearLayout>
`
UPDATE I tried this, but the app crashes.