【发布时间】:2013-12-14 22:12:10
【问题描述】:
我想插入一个图像来做一个按钮。但我想通过代码插入它,而不是 .xml 文件。有人知道吗?
【问题讨论】:
标签: java android image button imagebutton
我想插入一个图像来做一个按钮。但我想通过代码插入它,而不是 .xml 文件。有人知道吗?
【问题讨论】:
标签: java android image button imagebutton
试试这个:
ImageButton ib = new ImageButton(this);
yourContainer.addView(ib);//here yourContainer is ParentLayout
【讨论】: