Android drawSelectorOnTop with GridView

前端 未结 2 1668
一向
一向 2020-12-29 14:38

I am developing a tabbed application in which one of the fragments, CollectionsFragment, contains a GridView with an ImageView in each slot. I would like the to use a selec

2条回答
  •  Happy的楠姐
    2020-12-29 15:26

    1. Try setting the xml attribute android:drawSelectorOnTop in your activity_collections.xml file

    2. See if placing gridView.setDrawSelectorOnTop(true); after gridView.setAdapter(); helps. Sometimes, the order matters (weird)

    3. If all else fails, you may have to switch GridView to some other view where setDrawSelectorOnTop() is proven to work consistently.

    HTH

提交回复
热议问题