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);
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);
相关文章推荐
- Android 如何把一个 RelativeLayout或ImageView背景设为透明
- android 如何把一个 RelativeLayout或ImageView背景设为透明
- android 如何把一个 RelativeLayout或ImageView背景设为透明 分类: Android多媒体 2015-01-18 10:37 74人阅读 评论(0) 收藏
- 如何在MapView上画一个透明的背景
- 在Android中如何获取视频的第一帧图片并显示在一个ImageView中
- 如何在圆形 imageView android 上添加一个阴影和边界?
- 在Android中如何获取视频的第一帧图片并显示在一个ImageView中
- android 如何判断一个 View textview imageview etc 是否绘制完成
- android中使用selector动态改变imageView或ImageViewButton的背景
- 关于TextView和ImageView的背景及透明设置小结
- Android webview背景设置为透明无效
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- Android 多个ImageView图片层叠透明区域点击事件穿透
- 如何让一个button 的 backgroundimage 等比例缩放 background imageview 并不完美
- 【Android 如何置底一个View(附 前置声明layout布局文件中的资源ID)】
- android 怎么把网络图片生成一个Bitmap显示在ImageView中
- Android的ImageView如何显示网络图片资源
- 如何将Android ImageView放到布局的中心
- android网络上获取图片作为ImageButton和ImageView的背景
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte