I have a listview that is working fine. Now I have one option to enable and that is deleting the row. I know this is not a problem But Want to take some suggestions. and that is what is a best way of deleting the item(row). Here what I have tries I am sharing with you
What are prerequisites :
I am using fragments with one single activity and using tool bar so I really can use delete option appearing in toolbar for only one fragment . Actually I do not know how to do it.
So please tell me what are the good and best way which are user friendly , looks good in gui and also a Beginner developer friendly
答案 0 :(得分:1)
One solution is,
Add hidden checkbox in each listview row.
Add delete button on the toolbar/actionbar.
OnClicking delete button show checkboxes to select multiple items to delete.
Again clicking on delete should ask confirmation dialog and delete if user agrees.
答案 1 :(得分:0)
您可以使用Recyclerview而不是ListView。添加/删除项目时,它具有默认动画。您可以检查代码here,也可以在项目中提供交叉图标,然后单击即可删除。