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.
精彩评论