Android的标签下划线颜色不改变下划线、不改变、颜色、标签

由网友(↙℡KiSsヤ﹖)分享简介:所以,我基本上是看着每次看到网上关于如何更改蓝色下划线的选项卡资源,但是所有的建议已经没有我的情况下工作。So I've basically looked into every resource I saw online on how to change the blue underline in the tabs,...

所以,我基本上是看着每次看到网上关于如何更改蓝色下划线的选项卡资源,但是所有的建议已经没有我的情况下工作。

So I've basically looked into every resource I saw online on how to change the blue underline in the tabs, but all of the advice has not worked in my case.

我试过actionbarsherlock,appcombat,从操作栏生成器全息但所有的着色所做的是颜色顶部操作栏,而不是标签下划线。和是文件并编译和没有任何错误,但由于某些原因,它似乎下划线永远不会被甚至通过发生器改变。

I tried actionbarsherlock, appcombat, holo from Action Bar Generator but all the coloring did was color the top action bar, not the tab underline. And yes the files did compile and did not have any errors, but for some reason, it seemed like the underline would never be changed even through the generator.

我很困惑如何更改默认的蓝色下划线的标签,我会如此极端AP preciate,如果有一个工作的自定义样式的XML,你也有同感。

I am confused on how to change the default blue underline on the tabs, and I would SO EXTREMELY appreciate it if there was a working custom style xml that you would share.

在去Changing动作条的标签下划线颜色progrmatically 结果还是一样:/

After going to Changing ActionBar tabs underline color progrmatically result is still same :/

屏幕从其他网页后尝试射门: https://p.xsw88.cn/allimgs/daicuo/20230913/810.png

Screen shot after trying from other page: https://p.xsw88.cn/allimgs/daicuo/20230913/811.png

任何人能帮助我吗?

推荐答案

我一直在努力奋斗着这个好几天,最后还是找到了解决办法。我使用AppCompat。您可以在主题设置 colorAccent ,这将改变你的动作条高亮颜色。像这样:

I've been struggling with this for days, but finally found the solution. I'm using AppCompat. You can set colorAccent in your theme and that will change the highlight color on your ActionBar. Like so:

<item name="colorAccent">@color/highlightcolor</item>

这是在上下文中:

Here it is in context:

<style name="LightTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/darkgrey</item>
    <item name="colorPrimaryDark">@color/black</item>
    <item name="colorAccent">@color/highlightcolor</item>
</style>
阅读全文

相关推荐

最新文章