简体   繁体   English

自定义标题中的背景图片

[英]Background image in Custom Title

I searched and couldn't find a solution that was unique to my problem. 我进行了搜索,但找不到适合我的问题的解决方案。 I need to replace the below background color with a background image. 我需要将以下背景色替换为背景图片。 Your help is awesomely appreciated. 非常感谢您的帮助。

Edit: Problem solved. 编辑:问题解决了。 I was trying to edit the wrong xml file. 我试图编辑错误的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>

Can't you do: 你不能做:

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

?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM