Android Spinner - How to make dropdown view transparent?

前端 未结 5 1801
有刺的猬
有刺的猬 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:09

    You can override the style for the dropdown, and the dropdown item by using a Theme in your app that inherits from one of the Android themes, then override the

    android:dropDownSpinnerStyle, or android:spinnerDropDownItemStyle, and even the android:dropDownListViewStyle attribute of the theme, pointing to your own custom style instead of the Android style that is defined in their theme. I created a fully customized spinner this way, with a transparent button AND dropdown. I even got rid of the dropdown list dividers, and set my own spacing for the dropdown items when I built the tablet app for Fandango (take a look at the sort movies spinner on the main page of the app).

    Everything in Android is customizable, you just have to know where to look. ;-)

提交回复
热议问题