Android中用代码设置ImageView的src和background

代码设置ImageView的src:

setImageDrawable(Drawable drawable);
setImageBitmap(Bitmap bm);
setImageResource(int resId);

代码设置ImageView的background:  

setBackgroundReource(int resid)
setBackground(Drawable background)
setBackgroundColor(int color)
setBackgroundDrawable(Drawable background) //This method was deprecated in API level 16. use setBackground(Drawable) instead











你可能感兴趣的:(android)