android App啟動白屏

來源:互聯網
上載者:User

標籤:填充   targe   splash   log   preview   android   黑屏   tar   方式   

app啟動的時候在啟動也顯示之前會出現白屏或黑屏的情況。

主要是因為視圖沒有及時填充上造成的,解決方式如下:

在style中添加以下代碼:

<style name="SplashTheme" parent="AppTheme">       1 <!--<item name="android:windowBackground">@drawable/first</item>-->//此行可以給window設定背景圖片,這樣的話在響應期間會顯示該圖片。       2 <item name="android:windowFullscreen">true</item>       3 <item name="windowNoTitle">true</item>       4 <item name="android:windowIsTranslucent">true</item>//把window背景設定為透明,這樣的話響應期間就不會看到白屏,此方式可以不設定背景圖片。但是會有啟動延時的情況。        <!--<item name="android:windowDisablePreview">true</item>-->    </style>

然後在資訊清單檔中把啟動頁的 theme設定為以上theme。

 

參考博文:http://www.jianshu.com/p/09b876b865ac

android App啟動白屏

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.