Replacing ListView row with another layout onClick

前端 未结 2 1300
温柔的废话
温柔的废话 2021-01-06 10:35

I have a ListView with only TextView. I want an implementation in which if I click on a ListView row, an edittext with a replace button should appear and whatever I type in

2条回答
  •  长发绾君心
    2021-01-06 11:20

    You can go with either of two solutions below :

    1. Include an edittext and replace button along with the textview layout and that should be in hidden state. While clicking on the list item change the visiblity of edit text and button to visible and change that of textview to Gone. While clicking on the replace button, reverse the visibility change.

    2. While clicking on the list item, show an alert box with a edittext and replace button. After changing the content and clicking on the replace button, change the textview content to changed value.

提交回复
热议问题