Change spinner background color but keep arrow

前端 未结 11 1356
予麋鹿
予麋鹿 2020-12-13 01:41

I\'ve read several thing about it but I can\'t find what I need. I want to keep the grey arrow but I want to remove the horizontal bar from the default style and have a whit

11条回答
  •  隐瞒了意图╮
    2020-12-13 02:15

    A good way to customise spinners and any other Android controls is to use the Android Asset Studio site and choose the Android Holo Colors Generator. This will create all the assets you might need, including the "underline". It also generates the XML files that implement the changes.

    Once you download the ZIP file from that site, you just copy the images and XML files into your project.

    You can then edit the required image files to remove the underline. They are 9-Patch files, called:

    • apptheme_spinner_default_holo_light.9.png
    • apptheme_spinner_disabled_holo_light.9.png
    • apptheme_spinner_focused_holo_light.9.png
    • apptheme_spinner_pressed_holo_light.9.png

    For a more complete explanation of the process, and to see some of the sample XML files, please refer to my related answer:

    • Change colour of small triangle on spinner in android

提交回复
热议问题