Android 标题栏颜色的奇怪行为

Android 标题栏颜色的奇怪行为,android,android-ui,Android,Android Ui,我打算改变标题栏的颜色,实际上它工作得很好 <style name="CustomTheme.Dark" parent="android:Theme.Black"> [...] <item name="android:windowTitleBackgroundStyle">@style/TitlebarBackground.Dark</item> </style> <style name="TitlebarBackgroun

我打算改变标题栏的颜色,实际上它工作得很好

<style name="CustomTheme.Dark" parent="android:Theme.Black">
    [...]
    <item name="android:windowTitleBackgroundStyle">@style/TitlebarBackground.Dark</item>
</style>

<style name="TitlebarBackground.Dark">
    <item name="android:background">#303031</item>
</style>
有人对此有任何解释吗。。。好。。。奇怪的行为

编辑: 出于某种奇怪的原因,以编程方式设置标题栏背景色同样有效:

View title = ((ListActivity) context).getWindow().findViewById(android.R.id.title);
View titleBar = (View) title.getParent();
titleBar.setBackgroundColor(context.getResources().getColor(R.color.border_color_dark));

这样我也可以使两种颜色相等。不过,我不明白为什么在
XML
中指定标题栏颜色不起作用。没有线索。非常神秘。

可能与属性有关,但我不确定。。。它看起来确实像是一些android优化。
View title = ((ListActivity) context).getWindow().findViewById(android.R.id.title);
View titleBar = (View) title.getParent();
titleBar.setBackgroundColor(context.getResources().getColor(R.color.border_color_dark));