开启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 实现button的背景改变
  2. Android 全局背景音乐
  3. Android样式和主题(style&theme)

随机推荐

  1. Android(安卓)ScrollView用法
  2. android 状态栏提醒 Notification 的使用
  3. 修改android studio 新建项目的build.gra
  4. Android(安卓)Permission denied 错误
  5. Android图文识别
  6. android apk签名生成及配置
  7. Android(安卓)SDK Download List
  8. 通过gae访问android官方文档
  9. Android(安卓)对多个EditText监听
  10. android 飞行模式分析