How do you make a LinearLayout scrollable?

前端 未结 10 1862
清歌不尽
清歌不尽 2020-11-28 18:55

I have lot of items on the screen and I need to use the scrollbar so the user can scroll down. However, the scroll is either not visible or it\'s not working. How is it poss

10条回答
  •  星月不相逢
    2020-11-28 19:28

    Here is how I did it by trial and error.

    ScrollView - (the outer wrapper).
    
        LinearLayout (child-1).
    
            LinearLayout (child-1a).
    
            LinearLayout (child-1b).
    

    Since ScrollView can have only one child, that child is a linear layout. Then all the other layout types occur in the first linear layout. I haven't tried to include a relative layout yet, but they drive me nuts so I will wait until my sanity returns.

提交回复
热议问题