代码设置ImageView的src:
- setImageDrawable(Drawable drawable);
- setImageBitmap(Bitmap bm);
- setImageResource(int resId);
代码设置ImageView的background: copy
- setBackgroundReource(int resid)
- setBackground(Drawable background)
- setBackgroundColor(int color)
- setBackgroundDrawable(Drawable background) //This method was deprecated in API level 16. use setBackground(Drawable) instead