以编程方式更改 ActionBar 选项卡下划线颜色

问题描述:

我已经通过

ActionBar actionbar = getActionBar()

操作栏的背景由

actionbar.setBackgroundDrawable(actionBarBackgroundImage);

现在我需要以编程方式更改操作栏选项卡的下划线颜色.有没有什么方法可以改变操作栏标签下划线颜色?

Now I need to change the action bar tabs underline color programmatically. Is there any method to change the action bar tabs underline color?

或者你可以使用 Android Action Bar样式生成器可轻松为您的操作栏和标签设置主题.

Alternatively you could use Android Action Bar Style Generator to easily theme your action bar and tabs.