現象
Acitivity啓動後總是先看到黑色背景,然後纔會顯示界面,這樣體驗不是太好
解決方案 - 修改主題
<!-- AndroidMainifest.xml -->
<application
android:theme="@style/MyTheme"
<!-- styles.xml -->
<resources>
<!-- 其中parent可以爲 android:Theme 或 android:Theme.NoTitleBar; android:windowBackground可以爲背景圖 -->
<style name="MyTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
</style>
參考: