android 设置背景为空(透明)

在给控件设置背景时像ps那样的背景透明

在3.0以下可以使用

imageView.setBackgroundResource(android.R.id.empty);

但是这个方法在3.0以上会出现

ERROR/AndroidRuntime(xxxxx): Caused by: android.content.res.Resources$NotFoundException: File  from drawable resource ID #0x1020004
可以用
imageview.setBackgroundColor(Color.parseColor("#00000000"));

imageview.setBackgroundColor(android.R.color.transparent);

posted on 2014-05-16 00:06  lialzm  阅读(3304)  评论(0编辑  收藏  举报

导航