Set the background to a given resource. The resource should refer to a Drawable object or 0 to remove the background.
-
Parameters:
- resid The identifier of the resource. @attr
ref android.R.styleable#View_background
View.setBackgroundResource(0),移除背景,包括:背景颜色,图片等等,亮度没测试
例如:View.setBackgroundColor(Color.BLUE); 背景颜色设置为 Blue
View.setBackgroundResource(0) 可以移除背景颜色。