The method setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom) sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use 0 if you do not want a Drawable there. The Drawables' bounds will be set to their intrinsic bounds.
example:
example:
Button imageButton = (Button)findViewById(R.id.imagebutton); imageButton.setCompoundDrawablesWithIntrinsicBounds( 0, //left 0, //top R.drawable.icon, //right 0); //bottom
No comments:
Post a Comment