应用在初次启动的时候有黑屏闪过(或者白屏),因为系统默认的theme(主题里设置了颜色)设置了启动时的北京颜色。那么怎么能改变一下,让它变的好看点呢?
看了很多,发现stackoverflow.com上有很多好东西啊。前一段时间有人说学会了Google,Stackoverflow.com,就不愁写代码了。资源太多了。
消除activity启动时的初始白屏或黑屏问题
1. style.xml中中增加
<style name="AppTheme" parent="android:Theme.Holo.Light">
<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>
</style>
2 acvitiy 的属性中加上
android:theme="@style/AppTheme"
Android 解决程序启动时的黑屏问题
http://www.eoeandroid.com/forum.php?mod=viewthread&tid=208904&fromuid=511991
http://www.cnblogs.com/loulijun/archive/2013/04/09/3010318.html
http://www.linuxidc.com/Linux/2012-02/53064.htm
http://www.cnblogs.com/U-tansuo/archive/2013/03/27/U_tansuo-android.html
http://stackoverflow.com/questions/10292708/change-application-background-image
http://stackoverflow.com/questions/9535695/dynamically-find-the-theme-name-in-android-application/9537629#9537629
http://stackoverflow.com/questions/14425868/whats-the-difference-between-windowbackground-and-background-for-activities-sty
http://android-developers.blogspot.co.il/2009/03/window-backgrounds-ui-speed.html
http://stackoverflow.com/questions/10173158/android-custom-theme-different-theme-for-landscape-and-portrait-mode
http://blog.sina.com.cn/s/blog_6004d60d0101i1er.html(所有样式请参考\sdk\docs\reference\android\R.attr.html)
注意看这里的onCreate中的setContentView()后面的那句话:
http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/activity/ShelvesActivity.java