Android several commonly used layout although have scrollbar attribute, but can not realize when the content too much automatically appears in the activity scrollbar, later found that the situation is actually need to use the ScrollView to deal with, The specific configuration can be as follows:
<?xml version= "1.0" encoding= "Utf-8"?> <linearlayout xmlns:android= "http://schemas.android.com/apk/res/" Android "android:orientation=" vertical "android:layout_width=" fill_parent "android:layout_height=" Wrap_content " > <scrollview android:layout_width= "fill_parent" android:layout_height= "wrap_content" > <LinearLayout Android:id= "@+id_scrollbar/layout1" android:orientation= "vertical" android:layout_width= "Fill_parent" Android: layout_height= "Wrap_content" > ... </LinearLayout> </ScrollView> </LinearLayout>
Or
<?xml version= "1.0" encoding= "Utf-8"?> <scrollview xmlns:android= "http://schemas.android.com/apk/res/" Android "Android:layout_width=" Fill_parent "android:layout_height=" wrap_content "> <linearlayout android:o rientation= "vertical" android:layout_width= "fill_parent" android:layout_height= "Wrap_content" > ... </ Linearlayout> </ScrollView>
One of the things to note is that there is only one child element inside the ScrollView, so all the child elements need to be placed inside a linearlayout.