开发者

Can setDisplayShowTitleEnabled be set in xml to theme an ActionBar?

开发者 https://www.devze.com 2023-03-31 20:15 出处:网络
I am trying to theme an ActionBar开发者_如何学Python in xml rather than code. So far I have this:

I am trying to theme an ActionBar开发者_如何学Python in xml rather than code. So far I have this:

<style name="TestTheme" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/TestActionBar</item>
</style>

<style name="TestActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@drawable/actionbar_background</item>
</style>

This is giving me my custom background and I want to be able to turn off the title here as well. In code, I would set setDisplayShowTitleEnabled to false. How do I do it in xml?


ok, here is the answer. Adding this to the second style block above hid the titles.

<item name="android:displayOptions">showHome|useLogo</item>
0

精彩评论

暂无评论...
验证码 换一张
取 消