删除背景图像

时间:2014-01-08 07:20:28

标签: android

我将背景图像设置为

android:background="@drawable/drag"

现在我想从活动中删除此图片

查看configView = LayoutInflater.from(this).inflate(                 R.layout.detail_view,null); 这怎么可能。我使用的是SDK版本14。

感谢您的关注。

3 个答案:

答案 0 :(得分:2)

如果布局

,请尝试此操作
  

1)RelativeLayout relative =(RelativeLayout)   findViewById(R.id.widget29); relative.setBackground(NULL);

这与视图相关

  

2)imgView.setImageResource(android.R.color.transparent);

欢呼声。

答案 1 :(得分:0)

尝试

android:background="@null"

android:background="@android:color/transparent"

答案 2 :(得分:0)

在代码中使用view.setbackground(null)(API级别> = 16)或view.setBackgroundDrawable(null)(对于API级别< 16),只要您需要以编程方式删除它们。