How to add text to image in grid view?

2019-09-16 17:20发布

问题:

well i have gridview , which pulls the images from server & display it in gridview, i want to add related text to each image.it must look like the below image. How to achive that ?

回答1:

in order to fill a GridView you got to create an item(Xml layout); then in the adapter you'll got to inflate it and fill it up; so you are able just to create a FrameLayout with an image and a textView with gravity bottom and background #66666666 where #AARRGGBB AA-is an alfa chanel(transparecy);