android – Actionbar Compat更改标题textColor

android – Actionbar Compat更改标题textColor,第1张

概述我试图修改ActionBarSupport标题的文本颜色.我用 ActionBarStyleGenererator创建了一个颜色正确的主题,效果很好. 在使用灯光主题时,我想将标题的颜色更改为白色(在生成器中我无法设置文本颜色(.由于多种原因,我无法使用黑暗的动作栏主题.我非常接近,只是有得到白色的标题;-) 我在这做错了什么? <style name="ActionBar.Transparent 我试图修改ActionbarSupport标题的文本颜色.我用 ActionBarStyleGenererator创建了一个颜色正确的主题,效果很好.

在使用灯光主题时,我想将标题的颜色更改为白色(在生成器中我无法设置文本颜色(.由于多种原因,我无法使用黑暗的动作栏主题.我非常接近,只是有得到白色的标题;-)

我在这做错了什么?

<style name="Actionbar.transparent.MyApp" parent="@style/Widget.AppCompat.light.Actionbar">    <item name="background">@drawable/ab_transparent_myapp</item>    <item name="progressbarStyle">@style/Progressbar.MyApp</item>    <item name="TitleTextStyle">@style/MyApp.TitleTextStyle</item>  </style> <style name="MyApp.TitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.Base.Actionbar.Title">    <item name="androID:textcolor">#ffffff</item>     </style>
解决方法 以下代码对我有用.我希望它能帮助你.
<style name="Apptheme" parent="AppBasetheme">        <item name="actionbarStyle">@style/ActionbarCompat</item>    </style>    <style name="ActionbarCompat" parent="@style/Widget.AppCompat.Base.Actionbar">        <item name="TitleTextStyle">@style/TitleStyle</item>    </style>    <style name="TitleStyle" parent="@style/TextAppearance.AppCompat.Widget.Base.Actionbar.Title">        <item name="androID:textcolor">@androID:color/white</item>    </style>
总结

以上是内存溢出为你收集整理的android – Actionbar Compat更改标题textColor全部内容,希望文章能够帮你解决android – Actionbar Compat更改标题textColor所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1134843.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存