Although several commonly used layout in Android have the scrollbar attribute, it cannot automatically display scrollbar on the activity when there is too much content, later, we found that scrollview is used to handle this situation. The specific configuration can be as follows:
<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <linearlayout xmlns: Android = "http://schemas.android.com/apk/res/android" <br/> Android: Orientation = "vertical" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> <br/> <scrollview <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> <br/> <linearlayout <br/> Android: Id = "@ + id_scrollbar/layout1" <br/> Android: orientation = "vertical" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> <br/>... <br/> </linearlayout> <br/> </scrollview> <br/> </linearlayout>
Or
<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <scrollview xmlns: Android = "http://schemas.android.com/apk/res/android" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> <br/> <linearlayout <br/> Android: Orientation = "vertical" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> <br/>... <br/> </linearlayout> <br/> </scrollview>
Note that only one subelement exists in the scrollview, so you need to put all the subelements in a linearlayout.