問題描述:點擊啟動圖標,剛啟動app時,app會有一個短暫的空白View,接著就會顯示app啟動的首個activity,
是什么原因造成這個現象? 步驟:啟動——>空白View——>顯示app的第一個activity
因為在AndroidManifest.xml中theme設置style時把windowBackground等背景被設置成了白色,
自定義一個style
如果啟動頁是一張圖片:<style name="Start_Theme" parent="@android:style/Theme.NoTitleBar"> <item name="android:windowBackground">@drawable/啟動頁的圖片名</item> <item name="android:windowNoTitle">true</item> </style>還有一種方法就是把windowBackground設置為透明,這種有個弊端就是點擊啟動圖標后,給人一種啟動延遲的感覺<style name="Start_Theme" parent="@android:style/Theme.NoTitleBar"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> </style>新聞熱點
疑難解答