I have a gridview I created using this tutorial GridView Android, which works just fine. Now I’d like to overlay an image onto the item of the gridview if say the item is clicked. I’m not sure how to do this, whether I use another gridview and merge them or just have lots of image views :s. Just to clarify the question: How do I overlay onto gridview items? Thanks in advance!
Share
So there are a few ways you might achieve this but possibly the most flexible would be to use a custom view in the
getViewmethod.Add a LayoutInflater to your ImageAdapter class:
Initialize it in the constructor:
This is used to inflate an xml view such as this:
Inflate this view in the ImageAdapter class
getViewmethodThen show the overlay image on click
This is a very basic example but hopefully you will find the approach useful.