Android的标签下划线颜色不改变 [英] Android Tab underline color not changing

查看:159
本文介绍了Android的标签下划线颜色不改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

在去<一href="http://stackoverflow.com/questions/16139259/changing-actionbar-tabs-underline-color-progrmatically/16140075#16140075">Changing动作条的标签下划线颜色progrmatically 结果还是一样:/

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

屏幕从其他网页后尝试射门: http://i.stack.imgur.com/ EOUbu.png

Screen shot after trying from other page: http://i.stack.imgur.com/EOUbu.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>

这篇关于Android的标签下划线颜色不改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆