The example in this article tells you that the Android ScrollView can only add one child control problem-solving method. Share to everyone for your reference, specific as follows:
There's a section of code here
<?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:o" rientation= "vertical" >
<scrollview
android:layout_width= "fill_parent"
android:layout_height= "Fill_parent" >
<button
android:layout_width= "fill_parent"
android:layout_height= "WRAP_" Content "/>
<button
android:layout_width=" fill_parent "
android:layout_height=" wrap_content "/>
<button
android:layout_width=" fill_parent "android:layout_height=" wrap_content "/>"
</ScrollView>
</LinearLayout>
A scrollview inside Add three button, perhaps you think that there is no problem, then we run a look at
An exception has occurred
Obviously, the anomaly tells us that ScrollView can host only one direct child
Since we can only hold a direct child control, we could accommodate multiple indirect child controls, and then set a layer of linearlayout directly outside the child controls.
<?xml version= "1.0" encoding= "Utf-8"?> <linearlayout "xmlns:android="
Schemas.android.com/apk/res/android "android:layout_width=" fill_parent "android:layout_height=" Fill_parent " android:orientation= "vertical" > <scrollview android:layout_width= "fill_parent" android:layout_height= "fil"
L_parent "> <linearlayout android:layout_width=" fill_parent "android:layout_height=" Fill_parent " android:orientation= "vertical" > <button android:layout_width= "fill_parent" Android:layout_ height= "Wrap_content"/> <button android:layout_width= "Fill_parent" android:layout_height= P_content "/> <button android:layout_width= fill_parent" android:layout_height= "Wrap_content" /> </LinearLayout> </ScrollView> </LinearLayout>
For more information on Android-related content readers can view the site topics: "Android Development Introduction and Advanced Course", "Android Multimedia operating skills Summary (audio, video, recording, etc.)", "Android Basic Components Usage Summary", " Android View tips Summary, Android layout layout tips and a summary of Android controls usage
I hope this article will help you with the Android program.