How to make a background fit with his button dynamically ? [Android] -


i want add image background buttons (which added dyncamilly), image original size looks applied default, , far big. how can adjust image fit button size automatically ?

drawable img = act.getresources().getdrawable(r.drawable.top); button.setbackground(img); 

use imagebutton http://developer.android.com/reference/android/widget/imagebutton.html

they should handle sizing automatically


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -