Spinner does not apply dropDownSelector attribute

前端 未结 3 1740
花落未央
花落未央 2020-12-17 17:05

I\'m using spinner and want to add spinner - to change behavior depends of states(focused, pressed)

sample project is here https://github.com/vovs/spinner_issue

3条回答
  •  [愿得一人]
    2020-12-17 17:43

    There may be other ways but here's what I understand from using one of the Generators.

    Declare your own style for the spinner in your res/values/styles.xml pointing to your drawable.

    
    

    Create res/values/themes.xml and declare your own theme that inherits from the current theme. Within this theme, add an item for each attribute you're modifying and point it to your custom style from the last step. I think this could go in the styles file if you wanted, but since the generator separates them I follow suit.

    
    

    In your AndroidManifest, add android:theme="@style/myCustomTheme" to the opening application tag.

    Your values for parent will depend on how the project is setup and I think this will style of the spinners in your project and not just one. Try it out and let me know what you get.

提交回复
热议问题