How can I add a TextView into an ImageView in GridView Layout?

后端 未结 3 677
野性不改
野性不改 2021-01-21 22:29

I need a GridView, but in each grid, there will be an ImageView and TextView over/inside it.

It will be like an item image in each grid, and name of the item on the imag

3条回答
  •  鱼传尺愫
    2021-01-21 22:55

    Create a RelativeLayout that contains the ImageView and the TextView,with TextView's bottom edge aligned with the Imageview's bottom edge.

    
        
         // or to top
    
    

    Inflate this layout in getView method of your adapter.

提交回复
热议问题