How do you make a LinearLayout scrollable?

前端 未结 10 1859
清歌不尽
清歌不尽 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:09

    You need to place ScrollView as the first child of Layout file and now put your linearlayout inside it. Now, android will decide on the basis of content and device size available whether to show a scrollable or not.

    Make sure linearlayout has no sibling because ScrollView can not have more than one child.

提交回复
热议问题