Noob here。按编号查找布局
我想点击一个按钮产卵的图像,为了做到这一点我从这个问题的一些代码:How do I create an ImageView in java code, within an existing Layout? 我使用的第一个答案的代码,但在行:
RelativeLayout rl = (RelativeLayout) findViewById(R.id.RelativeLayout01);
我不知道放什么,而不是“RelativeLayout01”,或者如何在“ID”
在此先感谢
这是您的布局xml中的ID。你有布局与relativelayout ID为'RelativeLayout01'在您的布局xml – Raghunandan
我知道我必须将其更改为“id”中的布局的名称,但我不知道如何使用id中的布局XML。 – Sochimickox
请阅读文档http://developer.android.com/guide/topics/ui/declaring-layout.html,而不是在此处提问 – Raghunandan