2017-08-13 28 views
0

啓動畫面出現問題。我已經開始使用drawable了(讓我們稱它爲'black'吧,因爲它有黑色的bacjground),但這並不是很好,所以我將它改爲另一個(讓它叫做'white')。啓動畫面中出現舊的可繪製

問題是,即使在改造完成請求和MainActivity啓動之後,黑色的drawable甚至會出現約1秒,然後出現'white'。我試圖清理/重建,invalide緩存,重新安裝應用程序..沒有工作。在類似的SO問題中,我發現我應該嘗試在另一個設備上啓動應用程序,但是,不幸的是,我只有一個,並且必須隨身攜帶。那麼,是否可以修復它,或者它是AndroidStudio中的錯誤?

艙單

<activity android:name=".ui.splash.SplashActivity" 
      android:theme="@style/SplashTheme"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 
</activity> 

splash_drawable.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item> 
     <color android:color="@android:color/white" /> 
    </item> 
    <item 
     android:drawable="@drawable/gift" 
     android:gravity="center"> 
    </item> 

</layer-list> 

SplashTheme

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> 
    <item name="android:windowBackground">@drawable/splash_drawable</item> 
</style> 

SplashTheme(V-21)

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> 
    <item name="android:windowBackground">@drawable/splash_drawable</item> 
    <item name="android:statusBarColor">@android:color/white</item> 
</style> 

回答

1

有時android studio不會刷新像images.so這樣的可繪製文件,請關閉你的android studio並重新啓動它可能會解決問題。

+0

當我使緩存失效後,演播室已經自動剋制。或者我應該自己做? – Valentun

+0

當我關閉工作室完成工作後,它開始按預期工作。謝謝。 – Valentun