Activity的透明、半透明效果
2016-04-14 10:07
316 查看
Activity的透明、半透明效果的设置transparent
res/values/styles.xml
res/values/color.xml
manifest.xml
java代码
配置结束。
转自:http://2960629.blog.51cto.com/2950629/742499
res/values/styles.xml
1 2 3 4 5 6 7 8 9 10 11 12 | <resources> <style name="Transparent"> <item name="android:windowBackground"> @color/transparent_background </item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle"> @+android:style/Animation.Translucent </item> </style> </resources> |
1 2 3 4 5 6 7 | <?xml version="1.0" encoding="utf-8"?> <resources> <color name="transparent_background">#50000000</color> </resources> //注意: //color.xml的#5000000前两位是透明的效果参数从00--99(透明--不怎么透明), //后6位是颜色的设置 |
1 2 3 4 | <activity android:name=".TransparentActivity" android:theme="@style/Transparent"> </activity> |
1 2 3 4 5 | public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Transparent); setContentView(R.layout.transparent); } |
转自:http://2960629.blog.51cto.com/2950629/742499
相关文章推荐
- MANIFEST.MF的用途(转载)
- 快速排序
- 第八周--Linux中进程调度与进程切换的过程
- SSH出现Host key verification failed
- 基础总结篇之一:Activity生命周期
- 游戏准备上线运营几个注意点
- java集合框架06——fail-fast机制
- require.js基本认识
- 単語
- android动画详解之一
- DMA(直接存储器存取)
- CentOS 配置SSH免密码登陆(公私钥登陆)
- git github gitlab之间是什么关系
- SpringMVC通过@PathVariable注解传递对象
- android 蓝牙ble设备开发
- 简单的UDP通信
- activiti自定义流程之整合(三):整合自定义表单创建模型
- 二维数组的排序
- mybatis 传参为 Integer 时 ,Mapper 文件 中判断 条件 问题,传入0值,直接忽略判断
- 成都Uber优步司机奖励政策(4月14日)