开发者

Remove image one by one on click

开发者 https://www.devze.com 2023-02-15 08:28 出处:网络
I want to know if it is possible to remove an image when the user clicks a button. I have th开发者_如何学JAVAree images and each time the user clicks, one image will disappear

I want to know if it is possible to remove an image when the user clicks a button.

I have th开发者_如何学JAVAree images and each time the user clicks, one image will disappear

If this is possible by removing the image from the id in xml that would be very useful.

Thanks.


How about just hiding an image when the button is clicked? If you only have a few images, and you define them in the xml layout, then that's the easiest way I think.

image.setVisibility(View.GONE);

In case you really want to get rid of the image, I suggest you use some AdapterView class, like GridView or ListView, view the images with those, and handle the deletion in a custom Adapter class.

0

精彩评论

暂无评论...
验证码 换一张
取 消