Android编程中activity启动时出现白屏、黑屏问题的解决方法
作者:天使之翼 时间:2023-03-09 06:15:03
本文实例讲述了Android编程中activity启动时出现白屏、黑屏问题的解决方法。分享给大家供大家参考,具体如下:
默认情况下 activity 启动的时候先把屏幕刷成白色,再绘制界面,绘制界面或多或少有点延迟,这段时间中你看到的就是白屏,显然影响用户体验,怎么消除呢?
在 Activity theme 设置style 即可
<style name="AppTheme" parent="android:Theme.Light.NoTitleBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@android:color/transparent</item>
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<application
android:name="com.skymobi.moposns.MyApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.skymobi.moposns.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
希望本文所述对大家Android程序设计有所帮助。
标签:Android,activity
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java语言求解完美数代码分析
2023-01-28 10:17:58
![](https://img.aspxhome.com/file/2023/1/64791_0s.png)
Java 方法(方法的定义,可变参数,参数的传递问题,方法重载,方法签名)
2021-07-29 20:17:19
![](https://img.aspxhome.com/file/2023/0/67460_0s.png)
c# 读取XML文件的示例
2023-11-04 00:51:17
![](https://img.aspxhome.com/file/2023/4/77284_0s.png)
C++二分查找(折半查找)算法实例详解
2021-12-21 04:05:55
Spring boot随机端口你都不会还怎么动态扩容
2021-09-29 10:10:14
![](https://img.aspxhome.com/file/2023/7/69727_0s.png)
elasticsearch集群发现zendiscovery的Ping机制分析
2021-05-25 05:40:55
![](https://img.aspxhome.com/file/2023/2/60572_0s.jpg)
浅谈JAVA实现选择排序,插入排序,冒泡排序,以及两个有序数组的合并
2023-11-20 09:26:40
![](https://img.aspxhome.com/file/2023/7/97827_0s.png)
Spring BeanFactory和FactoryBean有哪些区别
2023-06-25 07:42:09
Android 判断某个Activity 是否在前台运行的实例
2023-07-24 19:29:21
.Net WInform开发笔记(二)Winform程序运行结构图及TCP协议在Winform中的应用
2021-08-08 23:56:44
![](https://img.aspxhome.com/file/2023/8/96378_0s.jpg)
Jmeter 中 CSV 如何参数化测试数据并实现自动断言示例详解
2023-10-17 15:37:42
![](https://img.aspxhome.com/file/2023/5/125325_0s.png)
android实现图片闪烁动画效果的两种实现方式(实用性高)
2022-06-29 14:18:32
C# memcached缓存使用实例代码
2022-01-15 02:17:11
Java中的递归方法示例介绍
2023-07-20 18:04:11
Flutter实现图文并茂的列表
2023-11-10 21:21:45
![](https://img.aspxhome.com/file/2023/3/139283_0s.jpg)
Kafka Producer中的消息缓存模型图解详解
2022-05-03 06:00:13
![](https://img.aspxhome.com/file/2023/2/61012_0s.jpg)
Spring Boot如何优化内嵌的Tomcat示例详解
2023-11-13 17:52:53
Compose状态保存rememberSaveable原理解析
2021-12-26 10:07:56
![](https://img.aspxhome.com/file/2023/9/101819_0s.png)
C#实现文本文件读写方法汇总
2023-10-27 16:57:40
springboot默认日志框架选择源码解析(推荐)
2021-06-19 08:02:51