Android Delete from listview

前端 未结 3 1539
不知归路
不知归路 2021-01-28 19:11

I have listview that contain checkbox and an image when the checkbox is clikced I show a button at bottom of the screen that perform deletion, but when listview height more ,the

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-28 19:53

    I have had a similar issue in the past. I found that using a relative layout and defining the button before the list solved my issues. Lets consider the following.

    
    
        

    Here I have defined a Relative layout, the layout will occupy the full screen's width and height. I then place the button on the bottom of the RelativeLayout. My expectation is that the list will be placed above the defined button, and fill the remainder of the screen with list contents. Because we are telling the list View to be placed above the button, it will never grow large enough to cover the button causing the list view to mask the button clicks from the user.

    hope this helps.

提交回复
热议问题