How do I apply a style programmatically?

后端 未结 5 704
醉梦人生
醉梦人生 2020-12-08 10:46

I have a styles called Red and Green and I have an if statment to find out which to apply, but I don\'t know the code to actually apply a style from the java.

5条回答
  •  无人及你
    2020-12-08 11:41

    I found out this is only able to be done when creating an View from inside the Java. If it is defined in the XML before hand you cannot dynamically change the style.

提交回复
热议问题