Android Spinner - How to make dropdown view transparent?

前端 未结 5 1804
有刺的猬
有刺的猬 2020-12-03 08:41

I have a custom spinner dropdown xml file in /res/layout/:

spinner_view_dropdown.xml:




        
5条回答
  •  情话喂你
    2020-12-03 09:04

    The layout you're defining is only used for an entry of your drop-down, not the drop-down itself. So setting the background to transparent won't have any effect on its background. But even if it would, setting the background to transparent would still have no effect, because a TextView (actually I believe any view) has a transparent background by default.

    That being said, the right question would be: can you provide a custom layout for an entry's parent view (which is probably a List)? As far as I know, the answer is no, unfortunately.

提交回复
热议问题