我已经下载的图像在运行时。现在我想将它设置为背景的相对布局如何呢?是否有可能。
I have downloaded image at run time. Now I want to set it as a background for relative layout how to it? Does it possible.
退房的 setBackgroundDrawable ,或者在绘制对象类createFromPath 。
RelativeLayout rLayout = (RelativeLayout) findViewById (R.id.rLayout);
Resources res = getResources(); //resource handle
Drawable drawable = res.getDrawable(R.drawable.newImage); //new Image that was added to the res folder
rLayout.setBackground(drawable);