2012-02-22 76 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"