android - Setting border around Button dynamically? -


is possible set border around button dynamically in android? can use statically stroke in shape not know how code.

it's deprecated in newer versions of android, use setbackgrounddrawable() call change how our buttons dynamically in code:

            mybutton.setbackgrounddrawable(res.getdrawable(r.drawable.btn_gray)); 

if define drawable has border style want should update when need to.

if you're using later version of api, should able call mybutton.setbackground() instead.


Comments

Popular posts from this blog

java - How to print docx and pdf? -

qml - Is it possible to implement SystemTrayIcon functionality in Qt Quick application -

java - IntelliJ to move a class along with conflicted classes to a new package? -