代码设置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











相关文章:

  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
相关资源
相似解决方案