消除 activity 启动时白屏、黑屏问题
16lz
2021-01-26
默认情况下 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(安卓)RxJava创建操作符Timer的方法
- Android(安卓)快速开发之快速实现“我”界面
- Android信息界面编辑及组合控件的封装
- Android在onCreate或者在Fragment的onCreateView中获取控件、屏
- Android电子书翻页效果实现
- Android(安卓)浏览器设置中的搜索引擎
- Android(安卓)App项目开发步骤小结
- 【边做项目边学Android】手机安全卫士05_2:程序主界面,为每个条目
- Android(安卓)常用的Intent的URI及示例