如题所示,如果仔细一点确实会发现这样的问题: Android启动界面先白屏然后才出现画面。
解决方法如下:
在values文件夹下有个styles.xml
在里面定义一个样式:
<style name="Theme.AppStartLoadTranslucent" parent="AppTheme"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> </style>再去androidmanifest.xml下的Activity添加刚刚定义的主题
<activity android:name=".MainActivity" android:windowSoftInputMode="adjustPan" android:launchMode="singleTask" android:theme="@style/Theme.AppStartLoadTranslucent" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity>上面是我的activity
记在这里,方便以后查看(我也是看到别的博主写的,在此感谢http://blog.youkuaiyun.com/lzyang187/article/details/50819449)