本文介绍了如何以编程方式更改选项卡指示器颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的新到Android ,然后开始编程之前找到我,现在是一个天许多应用程序都使用片段,尤其是标签与Swipeable意见

如何改变的标签指示/高亮颜色(我用Google搜索,改变动作条颜色为红色编程),但不知道如何更改选项卡指示器颜色为红色。(优先级编程)

还是我的动作条看起来像

我使用下面的行来改变的动作条的背景颜色,但我也需要改变标签指示灯的颜色编程。

 动作条= getActionBar();
actionBar.setBackgroundDrawable(新ColorDrawable(Color.RED));
 

解决方案

我用杰夫Gilfelt,S Android的动作栏样式生成器。您可以使用图形用户界面风格你的标签,并在最后你得到的源$ C ​​$ C,您可以使用,查看和修改相应。 :)

下面是一个链接。

<一个href="http://jgilfelt.github.io/android-actionbarstylegenerator/#name=example&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutral$p$pssed=1&backColor=E4E4E4,100&secondaryColor=D6D6D6,100&tabColor=33B5E5,100&tertiaryColor=F2F2F2,100&accentColor=33B5E5,100&cabBackColor=FFFFFF,100&cabHighlightColor=33B5E5,100" rel="nofollow">http://jgilfelt.github.io/android-actionbarstylegenerator/#name=example&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutral$p$pssed=1&backColor=E4E4E4%2C100&secondaryColor=D6D6D6%2C100&tabColor=33B5E5%2C100&tertiaryColor=F2F2F2%2C100&accentColor=33B5E5%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100

I am new to Android, and before starting programming i found that now a days many of the apps are using Fragments, especially Tab with Swipeable Views

How to change Tab Indicator/highlight color (I googled and changed ActionBar color to RED programmatically), but don't know how to change Tab Indicator color to RED.(priority programmatically)

still my ActionBar looks like this

I am using below lines to change background color of ActionBar, but i also need to change the color of Tab Indicator programmatically.

actionBar = getActionBar();
actionBar.setBackgroundDrawable(new ColorDrawable(Color.RED));
解决方案

I use Jeff Gilfelt,s Android Action Bar Style Generator. You can use GUI to style your tabs and at the end you get the source code which you can use, review and modify accordingly. :)

Here's a link.

http://jgilfelt.github.io/android-actionbarstylegenerator/#name=example&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutralPressed=1&backColor=E4E4E4%2C100&secondaryColor=D6D6D6%2C100&tabColor=33B5E5%2C100&tertiaryColor=F2F2F2%2C100&accentColor=33B5E5%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100

这篇关于如何以编程方式更改选项卡指示器颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-19 22:28