Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set style(small and large) to Button programmable way?

Tags:

android

How to set style(small and large) to Button programmable way ?

Is it possible ?

I can set the style to the Button from xml resource (like styte= ?android:attr/buttonStyleSmall). But I don't know how set it programmable way.

Thanks in advance.

like image 626
Ferdinand Avatar asked Dec 23 '22 03:12

Ferdinand


1 Answers

You can do it like that:

Button button = new Button(this, null, android.R.attr.buttonStyleSmall);
like image 197
djnose Avatar answered Dec 24 '22 18:12

djnose