您的位置:首页 > 移动开发 > Android开发

android 如何把一个 RelativeLayout或ImageView背景设为透明

2015-01-18 10:37 651 查看
在项目中,需要把RelativeLayout 和 ImageView背景设置为透明,怎么实现呢?这里主要通过代码,请参阅以下关键代码:

public ImageView imgDetail;

private RelativeLayout rlMain;

rlMain= (RelativeLayout) findViewById(R.id.rlMain);//布局

imgDetail = (ImageView)findViewById(R.id.imgDetail); // 图片

//设置背景

rlMain.setBackgroundColor(Color.TRANSPARENT);

imgDetail.setBackgroundColor(Color.TRANSPARENT);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐