1

I've followed the tutorial here: http://developer.android.com/resources/tutorials/views/hello-gridview.html

I'm wondering how I get place text over the images in this gridview? I've seen other examples here @ stackoverflow but they are with linearlayouts or they gave up and just made custom images for each like here. Any help will be much appreciated!

Community
  • 1
  • 1
daveomcd
  • 5,951
  • 14
  • 77
  • 131

1 Answers1

1

I'm not sure if it's the best approach, but I would try to return a layout (which is an indirect subclass of View) that encapsulates both the ImageView containing the image and a TextView with the overlaying text.

So in stead of returning an ImageView in

public View getView(int position, View convertView, ViewGroup parent) { ... }

build something like a RelativeLayout, add both the ImageView and the TextView to it, and return the layout.

MH.
  • 44,788
  • 10
  • 100
  • 115