UI---设置Activity背景为透明
1.在values下colors中设置透明颜色
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="transparent">#64000000</color>
</resources>
2.在style中引入该color
</style>
<style name="Transparent">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
3.在清单文件中对应的Activity中添加该样式的主题
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SecondActivity" android:theme="@style/Transparent"> </activity>
</application>
UI---设置Activity背景为透明的更多相关文章
- Android设置Activity背景为透明style
方法一: 通过Theme.Translucent @android:style/Theme.Translucent @android:style/Theme.Translucent.NoTitleBa ...
- iOS设置截图背景图片透明
/** 设置图片背景为透明 */- (UIImage *)imageToTransparent { // 分配内存 const int imageWidth = self.size.width; co ...
- Android 代码设置Activity 背景透明
当指定Activity 样式 Them.Dialog 时候 又不同意用XML 设置 Activity 的背景颜色的时候 用代码 this.getWindow().getDecorView().setB ...
- android设置Activity背景色为透明的3种方
方法一:这种方法比较简单,只有一个步骤,只需要在配置文件中把需要设置为透明的activity的样式设置为 Android:theme="@android:style/Theme.Transl ...
- css 设置元素背景为透明
要设置某一元素的背景为透明,在 chrome .firefox.opera 下是这样的: rgba 中的最后一个参数 0.4 就是想要的透明度,范围在0-1之间. 在 ie 中一般是这样的: filt ...
- 关于anroid设置webview背景方法探讨(转)
最近的项目中一直关于webView设置背景色问题在研究,最终找到了解决的方法. 基于我项目的需求,从服务端传过来的是带有标签的文本,如果使用textView会让整个布局显得很乱,里面的<img ...
- QT模态对话框用法(在UI文件中设置Widget背景图,这个图是一个带阴影边框的图片——酷)
QT弹出模态对话框做法: 1.新建UI文件时,一定要选择基类是QDialog的,我的选择是:Dialog without Buttons(),如下图: 2.然后在使用的时候: MyDialog dlg ...
- 设置UITableView背景透明/监听cell左边的删除按钮的点击事件
_tableView = [[UITableView alloc] init]; _tableView.delegate = self; _tableView.dataSource = self; _ ...
- [Bug] 解决透明 Activity 在 Android 6.0 背景不透明
如何复现 连续启动两个 Activity ,其中 Activity 1 为 不透明 的 Activity Activity 2 为 透明 的 Activity 通常用于引导页面,例如:豌豆夹锁屏引导用 ...
随机推荐
- Springboot文件上传与下载
一.创建简单的springboot-web项目 二.文件上传属性配置 #默认支持文件上传 spring.http.multipart.enabled =true spring.http.multipa ...
- Quick RF Tips for General Reference
传送门:http://www.microwavetools.com/rf-tips-to-make-you-look-smart/ 全文搬运过来的,本篇文章并未有其它意义和目的,仅作为个人参考笔记,我 ...
- winform项目导入数据
一.点击导入按钮,弹出文件选择框 这个方法的使用要引用下面两个命名空间: using System.Windows.Forms;using DevExpress.XtraEditors; privat ...
- P4177 [CEOI2008]order 网络流,最小割,最大权闭合子图
题目链接 \(Click\) \(Here\) 如果没有租用机器就是一个裸的最大权闭合子图.现在有了租用机器应该怎么办呢? 单独拆点是不行的,因为会和直接买下的情况脱离关系,租借是和连边直接相关的,那 ...
- spring Boot 入门--为什么用spring boot
为什么用spring boot 回答这个问题不得不说下spring 假设你受命用Spring开发一个简单的Hello World Web应用程序.你该做什么? 我能想到一些 基本的需要. 一个项目 ...
- 你不得不用的MAC软件开发工具软件,个个万里挑一
作为软件行业,尤其是程序员,Mac上都不得不安装一些必备的MAC软件开发工具软件,下面给大家分享一些必装的MAC软件开发工具软件,以备日后之需,有备无患. 其中,包含各种语言的主流 IDE.开发辅助. ...
- 为程序启用 守护进程-- supervisior
待补充... Add this to your /etc/supervisord.conf: [rpcinterface:supervisor] supervisor.rpcinterface_fac ...
- 实验一 Java开发环境的熟悉(Linux + Idea) 20175301李锦然
https://gitee.com/ShengHuoZaiDaXue/20175301.git 实验一 Java开发环境的熟悉(Linux + Idea) 实验内容 1.使用JDK编译.运行简单的Ja ...
- 永续公债(or统一公债)的麦考利久期(Macaulay Duration)的计算
- Mongodb复杂查询,总结
内嵌文档复杂查询 数据结构 { "_id":"1412243", "info":{ "data":[ { "b ...