【发布时间】:2012-09-07 16:04:06
【问题描述】:
http://androiddrawableexplorer.appspot.com/ 我希望能够在我的项目中使用这些可绘制对象,但我的项目是在运行时生成的。我只使用 XML 来定义新的活动,因为坦率地说,我讨厌在 java 中使用 XML。我正在寻找与此类似的方法。一种不使用任何 XML 来“findByID”它需要的组件。谢谢你。 Drawable foo = new Drawable(bar);
【问题讨论】:
-
“我的项目是在运行时生成的”是什么意思?
-
您使用 Button derp = new Button(context); 而不是使用 FindById (Button);或者...而不是 setContentView(R.some.thing) 你使用 setContentView(new Scrollview(....));
标签: android resources system drawable r.java-file