如何操作栏设置粗体标题? [英] How to set bold title in Action Bar?
本文介绍了如何操作栏设置粗体标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编辑XML样式试图让活动标题加粗。
I am editing the style xml trying to get the Activity title bold.
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#81CFEB</item>
<item name="android:textStyle">bold</item>
</style>
但是,只有我可以设置为所需的背景色。我不知道为什么TEXTSTYLE没有被设置为粗体。
But only what I can set is the background color desired. I do not why the textStyle is not set to bold.
任何人都知道如何解决这个问题?
Anyone know how to solve it?
推荐答案
可以请尽量使用这样的:
Can you please try with this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyTheme.MyActionBar</item>
</style>
<style name="MyTheme.MyActionBar"parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">@style/MyTheme.MyActionBar.TitleTextStyle</item>
</style>
<style name="MyTheme.MyActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:background">#81CFEB</item>
<item name="android:textStyle">bold</item>
</style>
</resources>
这篇关于如何操作栏设置粗体标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文