【发布时间】:2013-08-04 23:37:23
【问题描述】:
我有一个应用程序可以生成 imageButtons 并将它们放在 TableRow 中。
但是,imageButton 在可绘制文件夹中的图像上没有的侧面有一个灰色边框。
如何以编程方式移除这些边框?到目前为止,我看到的解决方案在布局中使用了 xml 属性,但我无法使用该解决方案,因为我以编程方式生成了我的 imageButtons。
有什么想法吗?
【问题讨论】:
标签: android imagebutton
我有一个应用程序可以生成 imageButtons 并将它们放在 TableRow 中。
但是,imageButton 在可绘制文件夹中的图像上没有的侧面有一个灰色边框。
如何以编程方式移除这些边框?到目前为止,我看到的解决方案在布局中使用了 xml 属性,但我无法使用该解决方案,因为我以编程方式生成了我的 imageButtons。
有什么想法吗?
【问题讨论】:
标签: android imagebutton
找到了答案。
imageButton.setBackground(null);
【讨论】:
你可以使用
ImageButton btn = (ImageButton)findViewById(R.id.imagebutton);
btn.setBackground(null);
祝你好运
【讨论】: