android 如何把一个 RelativeLayout或ImageView背景设为透明
来源:互联网 发布:网络推广兼职是真是假 编辑:程序博客网 时间:2024/06/05 11:36
在项目中,需要把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);
主要用到类 :
android.graphics.Color 和 android.view.View 类的setBackgroundColor方法!
拓展:
android中其他继承android.view.View 类,背景设置为透明的方法也类似!
0 0
- android 如何把一个 RelativeLayout或ImageView背景设为透明
- android 如何把一个 RelativeLayout或ImageView背景设为透明
- android 如何把一个 RelativeLayout或ImageView背景设为透明
- PhotoShop中如何把一张图片的背景设为透明效果
- C#把Lable的背景颜色设为透明
- 如何把导航背景设置为透明?
- 如何将桌面图标的背景颜色设为透明
- android view的背景设为透明或者半透明
- GDI+ 将图片背景设为透明
- WPF 中将背景设为透明
- visio 把图片设为背景
- .NET中如何将LABEL(标签控件)背景设为透明
- 如何将TextView的背景设为透明但是文字不透明
- 如何让一个IFRAME调用页面的背景为透明?
- 如何让一个IFRAME调用页面的背景为透明
- ps把照片背景变成透明[原为白色或其他颜色]
- 想把图片当背景,但是其他控件背景设为透明色后,显示的是背景颜色的问题解决
- Button或者ImageButton的背景设为透明或者半透明
- Hibernate与 MyBatis的比较
- ListView的适配器笔记
- OPENSSL安装总是失败
- GPRS核心网信息元素—P-TMSI
- 基于repcached的 memcache 主从配置实现
- android 如何把一个 RelativeLayout或ImageView背景设为透明
- SDAU 搜索专题 18 Tempter of the Bone
- 跟我一起学习MySQL技术内幕(第五版):(第二章学习日记1)
- AngularJS 1.x学习<1>
- AIDL实例浅析
- C语言单链表实现
- nexus5进入recovery模式
- Java中怎样保持PNG背景的透明属性(背景不变黑)
- C++第3次作业