0

I have an application that generates imageButtons and places them in a TableRow.

However, the imageButton has a gray border along the sides that weren't on the image in the drawable folder.

How can I programmatically remove these borders? So far, the solution I've seen use the xml properties in the layout but I can't use that solution since I programmatically generate my imageButtons.

Any ideas?

Razgriz
  • 7,179
  • 17
  • 78
  • 150

2 Answers2

3

Found the answer.

imageButton.setBackground(null);

Razgriz
  • 7,179
  • 17
  • 78
  • 150
0

You can use

ImageButton btn = (ImageButton)findViewById(R.id.imagebutton);
btn.setBackground(null);

Good luck