Android - display snapshot of image under images in gridview

I use the version of the "Grid View" example on the Android developer site:

http://developer.android.com/resources/tutorials/views/hello-gridview.html

And I would like to display a small caption under each image.

Can someone please give an example of how this can be accomplished (i.e. what needs to be edited)?

Thanks!

+6
android
source share
2 answers

After looking a few more, I found a great example of how to do this here:

http://mytelcoit.com/2010/02/programming-android-create-icon-with-text-using-gridview-and-layout-inflater/

+11
source share

Instead of ImageAdapter return ImageViews from getView() you need a TylerAdapter that returns a LinearLayout or RelativeLayout for each cell, with a layout containing your ImageView and TextView signature.

Here is a free excerpt from one of the books that illustrates such things, although in the context of ListView instead of GridView . They are both AdapterViews , and therefore the methods are almost identical.

+6
source share

All Articles