啟動頁白屏解決方案

2021-07-09 05:45:31 字數 806 閱讀 5670

由於activity只能到onresume時,才能展示到前台,所以,如果為main activity設定背景的話,無論oncreate-onresume速度多快,都會出現短暫的白屏或者黑屏(視的background屬性)

其實解決的辦法很簡單,只需將你的splashactivity中的view的background屬性刪除,

然後在androidmanifest.xml為你的splashactivity加上theme屬性即可

xml**

android:name=".android.ui.activities.startactivity"

android:theme="@style/theme.start"

>

android:name="android.intent.action.main" />

android:name="android.intent.category.launcher" />

intent-filter>

activity>

name="theme.start"

parent="android:theme">

name="android

:windowbackground">@drawable/newlogin_bg

"android:windownotitle">true

style>

我發現白屏,黑屏問題和theme樣式有關,自定義theme,背景色搞成透明就沒這個問題了。

最好的解決方案是設定成透明的因為如果設定成主題背景設定成 則很難更換啟動頁了。

解決啟動白屏問題

解決方法 了解上面的原因後,既然黑白屏是更具我們設定的theme來決定了,那我們就可以直接從啟動頁的theme入手,解決這個問題。1.在androidmanifest檔案中設定 activity android name splashactivity android screenorientatio...

ireport啟動報錯解決方案

ireport啟動報錯解決方案 ireport啟動報錯 ireport cannot find jdk jdk5.0 or newer cannot be found in your mathine 上網搜了些文章,試了試幾個關鍵字都沒有發現解決方法,最後想可能用en會好些 如此平凡的問題 果然,i...

啟動白屏處理 如何優雅解決App啟動黑白屏

第一張是預載入頁,第二張是閃屏頁,閃屏頁只比預載入頁多了底部的圖示和網易雲 這四個字 其實是一整體,一張 而且給人的感覺是一直是預載入頁,不過底部的圖示和文字會慢慢出現,這樣的處理比單獨的顯示或者設定為透明更讓人能夠接受。下面我們就來 看看 styles檔案自定義theme true true nu...