自定义标题中的背景图像

时间:2012-04-20 22:54:29

标签: android android-layout

我搜索过,找不到我的问题所特有的解决方案。我需要用背景图片替换下面的背景颜色。非常感谢您的帮助。

编辑:问题解决了。我试图编辑错误的xml文件。

<resources>
    <style name='CustomTitleBackground'>
        <item name='android:background'>#3b5998</item>
    </style>
    <style name='CustomTheme' parent='android:Theme'>
        <item name='android:windowTitleSize'>45dip</item>
        <item name='android:windowTitleBackgroundStyle'>@style/CustomTitleBackground</item>
     </style>
</resources>

1 个答案:

答案 0 :(得分:1)

你不能这样做:

<style name='CustomTitleBackground'>
  <item name='android:background'>@drawable/my_background_image</item>
</style>