android实现activity半透明色
2015-08-14 10:36
369 查看
首先设定该activity的theme如下
android:theme="@android:style/Theme.Translucent.NoTitleBar"
此时该activity由android系统处理为透明色的
为了使activity有一定的半透明效果,可以在activity的xml布局文件中中加一个属性
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000" >
其中#80为背景的透明度,可以根据喜好来进行设置,下图是实现的效果
android:theme="@android:style/Theme.Translucent.NoTitleBar"
此时该activity由android系统处理为透明色的
为了使activity有一定的半透明效果,可以在activity的xml布局文件中中加一个属性
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000" >
其中#80为背景的透明度,可以根据喜好来进行设置,下图是实现的效果
相关文章推荐
- Android开源项目分类汇总
- android 检测常用的手势
- Error:duplicate files during packaging of APK /Users/text01/Desktop/Android错误信息的解决办法
- android应用中去掉标题栏的方法(保留原样式)
- Android中ListView结合CheckBox判断选中项
- android中log的区别
- arcgis for android 学习 - (1) 安装环境简述
- arcgis for android 学习 - (2) hello Wrold. 显示一个地图
- arcgis for android 学习 - (3) 图层的可见性
- arcgis for android 学习 - (4) 了解mapView的一些方法和事件
- android开发(8) 选项卡的切换
- android开发(9) 渐变动画演示(Tween Animation)
- android开发(10) 逐帧动画演示(Frame Animation)
- android开发(11) 消息栏通知(Notification)
- android:gravity 和 android:layout_Gravity
- android开发(4) 闪屏的实现
- android开发(5) 动态生成控件
- android开发(6) - 初遇handler
- android开发(7) 文件下载
- android开发(8) 使用ViewFlipper来用手势切换画面