How to set colorAccent in code?

后端 未结 1 1469
傲寒
傲寒 2021-01-16 12:21

I want to change my application\'s theme in code , so i google it ...
Unfortunately, i can\'t find any method to **

set colorAccent in java code

1条回答
  •  [愿得一人]
    2021-01-16 13:15

    You can not do this via code.

    You can set a default theme with this attribute.

    In the activity where you want to change the color, simply create another theme that inherits the default theme, but this new theme you put another color for coloAccent

    Default Theme:

        @color/default_color_app
        @color/default_color_app_dark
        @color/default_color_app_dark
    

    Another Activity:

    
    

    0 讨论(0)
提交回复
热议问题