开启Android应用,有时会出现闪屏现象,在此列出三种解决方案:

1、修改主题

设置当前主题为:@android:style/Theme.Translucent (透明背景)

2、修改当前主题属性:

在当前主题中添加如下透明属性:

 true

3、自定义主题,设置背景图片

  

 

Android自带主题

1android:theme="@android:style/Theme"

默认状态,即如果theme这里不填任何属性的时候,默认为Theme

2android:theme="@android:style/Theme.NoDisplay"

任何都不显示。比较适用于只是运行了activity,但未显示任何东西

3android:theme="@android:style/Theme.NoTitleBar“

背景主题的没有标题栏的样式

4android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

背景主题的没有标题栏且全屏的样式

5android:theme="@android:style/Theme.Black"

默认状态下黑背景

6android:theme="@android:style/Theme.Black.NoTitleBar"

黑背景主题的没有标题栏的样式

7android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

黑背景主题的没有标题栏且全屏的样式

8android:theme="@android:style/Theme.Light"

默认状态下亮背景,与上述黑背景Theme.Black相反

9android:theme="@android:style/Theme.Light.NoTitleBar"

亮背景主题的没有标题栏的样式,与Theme.Black.NoTitleBar相反

10android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"

亮背景主题的没有标题栏且全屏显示的样式,与Theme.Black.NoTitleBa.Fullscreenr相反

11android:theme="@android:style/Theme.Dialog"

对话框样式 将整个activity变成对话框样式出现

12android:theme="@android:style/Theme.InputMethod"

Window animations that are applied to input method overlay windows

13android:theme="@android:style/Theme.Panel"

删除掉所有多余的窗口装饰,在一个空的矩形框中填充内容,作用范围相当于把dialog中的所有元素全部去掉,只是一个空的矩形框,且此为默认的样式

14android:theme="@android:style/Theme.Light.Panel"

删除掉所有多余的窗口装饰,在一个空的矩形框中填充内容,作用范围相当于把dialog中的所有元素全部去掉,只是一个空的矩形框,且默认是light的样式

15android:theme="@android:style/Theme.Wallpaper"

使用墙纸做主题,默认状态。

16android:theme="@android:style/Theme.WallpaperSettings"

使用墙纸做主题,默认是使用将上一个界面调暗之后作为主题

17android:theme="@android:style/Theme.Light.WallpaperSettings"

使用墙纸做主题,默认Light状态

18android:theme="@android:style/Theme.Wallpaper.NoTitleBar"

使用墙纸做主题,且没有标题栏

19android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"

使用墙纸做主题,且没有标题栏,且全屏显示

20android:theme="@android:style/Theme.Translucent"

半透明状态下的背景,将运行此activity之前的屏幕作为半透明状态作为此activity运行时的样式。

21android:theme="@android:style/Theme.Translucent.NoTitleBar"

半透明状态下没有标题栏的背景,将运行此activity之前的屏幕作为半透明状态作为此activity运行时的样式。

22android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"

半透明状态下没有标题栏且全屏的背景,将运行此activity之前的屏幕作为半透明状态作为此activity运行时的样式。

 引用:http://blog.csdn.net/hongya1109110121/article/details/11985545

 

更多相关文章

  1. Android系统中自带的图标&一些预定义样式&参考颜色值
  2. Android(安卓)Activity 设置全屏
  3. Android:简单的开场界面
  4. android预定义样式
  5. Android系统中自带的图标&一些预定义样式&参考颜色值
  6. android 实现button的背景改变
  7. Android系统中自带的图标&一些预定义样式&参考颜色值
  8. Android(安卓)全局背景音乐
  9. android 图片相关处理

随机推荐

  1. Paint和Color的介绍
  2. android异步更新UI界面的方法
  3. 如何调试 Android(安卓)Framework?
  4. Android(安卓)studio 无线真机调试
  5. android 之 Notification 实例
  6. Android以请求参数来获取网络数据
  7. 在Android(安卓)Studio创建第一个Android
  8. Android内存管理机制之幽灵杀手——LowMe
  9. Download https://downloads.gradle.org/
  10. Android(安卓)Studio快速获得release签名