2012-02-22 73 views
0

在活動之間切換時是否可以更改背景的顏色? 我的意思是黑色的顏色什麼猿,而其中一個活動消失,並在第二次出現之前。謝謝。可以更改android背景黑色嗎?

+1

如何你在切換活動嗎?這聽起來不像典型的Android行爲。 – jprofitt 2012-02-22 17:35:56

+0

這是默認切換,我沒有放置任何動畫,沒有overridePendingTransition。只是想知道我是否可以改變黑色? – goodm 2012-02-22 17:40:27

回答

0

你可能會改變你使用的主題如下:

application android:icon="@drawable/icon" android:label="@string/app_name" 
    android:theme="@android:style/Theme.Light" > 

編輯 如文檔中提到:

<application android:theme="@style/CustomTheme"> 

,然後調整你喜歡的主題:

<style> 
<color name="custom_theme_color">#b0b0ff</color> 
<style name="CustomTheme" parent="android:Theme.Light"> 
<item name="android:windowBackground">@color/custom_theme_color</item> 
<item name="android:colorBackground">@color/custom_theme_color</item> 
</style> 

這裏是鏈接到主題http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme

+0

和自定義一個?我需要活動之間的灰色背景? – goodm 2012-02-22 18:54:12

+0

@goodm我編輯了我的答案。 – 2012-02-23 08:08:17

0

只要你需要頭部到activity_home.xml 在代碼起始行添加此背景參數設置屏幕黑

android:background="#ffffff"