欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android編程中activity啟動時(shí)出現(xiàn)白屏、黑屏問題的解決方法

 更新時(shí)間:2015年12月16日 15:40:45   作者:天使之翼  
這篇文章主要介紹了Android編程中activity啟動時(shí)出現(xiàn)白屏、黑屏問題的解決方法,涉及Android針對activity啟動設(shè)置的技巧,需要的朋友可以參考下

本文實(shí)例講述了Android編程中activity啟動時(shí)出現(xiàn)白屏、黑屏問題的解決方法。分享給大家供大家參考,具體如下:

默認(rèn)情況下 activity 啟動的時(shí)候先把屏幕刷成白色,再繪制界面,繪制界面或多或少有點(diǎn)延遲,這段時(shí)間中你看到的就是白屏,顯然影響用戶體驗(yàn),怎么消除呢?

在 Activity theme 設(shè)置style 即可

<style name="AppTheme" parent="android:Theme.Light.NoTitleBar"> 
 <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> 
 <!-- All customizations that are NOT specific to a particular API-level can go here. --> 
</style> 

<application 
 android:name="com.skymobi.moposns.MyApplication" 
 android:allowBackup="true" 
 android:icon="@drawable/ic_launcher" 
 android:label="@string/app_name" 
 android:theme="@style/AppTheme" > 
<activity 
 android:name="com.skymobi.moposns.MainActivity" 
 android:label="@string/app_name" 
 android:screenOrientation="portrait" > 
 <intent-filter> 
  <action android:name="android.intent.action.MAIN" /> 
  <category android:name="android.intent.category.LAUNCHER" /> 
 </intent-filter> 
</activity>

希望本文所述對大家Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論