Android java代码设置背景

设置background(背景)的函数:

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

设置src(前景)的函数:

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

你可能感兴趣的:(Android java代码设置背景)