Mark Neto
Mark Neto

Reputation: 145

Android - How to put labels in a Grid View

How can I put labels in a grid view?

Example: http://developer.android.com/design/building-blocks/grid-lists.html#with-labels

Upvotes: 1

Views: 1639

Answers (1)

android developer
android developer

Reputation: 116322

for the getView() method of the adapter , return a framelayout with an imageView , and a textview on the bottom (on top of the imageView) , similar to what's written on the first chunk of code here . you can use the inflater in order to use XML file for all of the thumbnails , if you wish, so that you can preview it on the visual editor.

also, for more information of views like the gridView ,watch this:

http://www.youtube.com/watch?v=wDBM6wVEO70

i know it's about listView , but the ideas are the same.

Upvotes: 1

Related Questions