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

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -