Android控件的透明显示
来源:互联网 发布:鹰身女郎知乎 编辑:程序博客网 时间:2024/05/19 00:40
1.子控件相对于父布局的透明显示。
例如:
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FF0000"> <View android:layout_marginTop="20dp" android:layout_width="match_parent" android:layout_height="100dp" android:background="#66000000"/></LinearLayout>
网上一般都是这个类型的,很容易就能搜到。
2.控件相对与兄弟控件的透明显示。
例如:
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <View android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FF0000"/> <View android:layout_marginTop="20dp" android:layout_width="match_parent" android:layout_height="100dp" android:background="#66000000"/></FrameLayout>
- 两个例子的效果图都是一样的。
这个要在FrameLayout这个布局类型里实现,之前为了做到在地图上方显示一行半透明字幕找了好久,都是第一种情况的,不能半透明显示,最后才发现用FrameLayout,发现好简单。
认识到:android各种布局都有各自的用处。
阅读全文
1 0
- Android控件的透明显示
- android 透明的标题逐渐显示
- 透明GIF图片显示控件
- static控件动态透明显示的完美解决方案
- static控件动态透明显示的完美解决方案
- static控件动态透明显示的完美解决方案
- static控件动态透明显示的完美解决方案
- android透明显示
- android 透明显示
- 透明的CEdit控件
- 透明的CEdit控件
- 透明控件的新发现!
- 透明控件的制作
- Winforms:透明的控件
- 透明位图的显示
- 透明位图的显示
- 透明位图的显示
- 透明位图的显示
- 开灯问题
- day16
- CentOS6.5 MySQL-读写分离
- SSH模拟试题
- 高德地图使用学习过程
- Android控件的透明显示
- Spring MVC—数据绑定机制,数据转换,数据格式化配置,数据校验
- 简单实现接口自动化测试(基于python+unittest)
- 那些最小化centos7安装图形化界面的坑
- 使用 Spring Cloud Stream 构建消息驱动微服务
- 通过一台wifi的笔记本和一根网线使台式机上网
- Quartz教程 第5课 SimpleTrigger
- day17
- ffmpeg 压缩摄像头采集的图片为*.H264文件