Disable scrolling of a ListView contained within a ScrollView

前端 未结 7 1004
迷失自我
迷失自我 2020-12-01 11:46

I want to show a Profile screen for my users.

It must have three views (2 Buttons and a ImageView) and a ListView to show the

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 12:39

    if you have to show limited number of items in list view and want to stop list view from scrolling then you must keep listview height greater then the items total height.

    for example you want to show 3 items. (height of row is 30). then items total height becomes 3 x 30dp = 90dp,

    so now you have to set listview height greater then 90. e.g: 100dp. so now your listview will not scroll in any case.

提交回复
热议问题