How to customize the style (small and large) to a programmable button?

How to adjust the style (small and large) to the button in a programmable way?

Is it possible?

I can set the Button style from the xml resource (e.g. styte =? Android: attr / buttonStyleSmall). But I do not know how it is programmed.

Thanks in advance.

+4
source share
2 answers

You cannot change the style at runtime, sorry.

+1
source

You can do it as follows:

Button button = new Button(this, null, android.R.attr.buttonStyleSmall); 
+10
source

Source: https://habr.com/ru/post/1307659/


All Articles