I am making an application for android that has some buttons like the picture I attached, these buttons are a ImageButton with GradientDrawable (button.setBackgroundDrawable (gd);
) to the picture frame and button.setImageBitmap (bp);
which is the image to start the application fee and finally got a button.setBackgroundColor (Color.TRANSPARENT);
for the background color.
Link image:
My question is, is there any way for me to stay button in the same way as in the attached picture but with a text on the button? Is that the ImageButton has no option to add text and should use simple Button but does not support this button to put these four characteristics and stay as in the photo. In the end what I try to achieve is a button closest thing to the photo I attached but with a text in the middle.
Deputy code I use to put the image and design of the button.
final ImageButton button = new ImageButton(this);
button.setBackgroundColor(Color.TRANSPARENT);
button.setImageBitmap(bp);
button.setAdjustViewBounds(true);
button.setId(contador);
button.setBackgroundDrawable(gd);