如何更改选定的选项卡的颜色 [英] How to change color of Selected Tab

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

问题描述

在其选择的如何改变标签的颜色,请参见下面的屏幕截图:

我显示橙色的动作条,以同样的方式我想告诉橙色代替淡蓝色。

要显示橙色的动作条的背景下,我使用跌破code:

 < XML版本=1.0编码=UTF-8&GT?;
<资源的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>

    <样式名称=Theme.MyAppTheme父=机器人:款式/ Theme.Holo.Light>
         <项目名称=机器人:actionBarStyle> @风格/ Theme.MyAppTheme.ActionBar< /项目>
    < /风格>

   <样式名称=Theme.MyAppTheme.ActionBar父=机器人:款式/ Widget.Holo.Light.ActionBar>
        <项目名称=机器人:背景>#FF4444< /项目>
    < /风格>

< /资源>
 

解决方案

我真的建议你使用动作条式电机

使用这个工具,你可以轻松的主题您在工具栏的图形元素。

How to change color of tab when its selected, see below screen shot:

i am showing Orange color in ActionBar, in a same way i wanna show orange color in place of light blue.

To show Orange color in ActionBar background, i am using below code:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="Theme.MyAppTheme" parent="android:style/Theme.Holo.Light">
         <item name="android:actionBarStyle">@style/Theme.MyAppTheme.ActionBar</item>
    </style>

   <style name="Theme.MyAppTheme.ActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">#FF4444</item>
    </style>

</resources>

解决方案

I really recommend you to use the Actionbar Style Generator.

With that tool you can easily theme your graphic elements in your toolbar.

这篇关于如何更改选定的选项卡的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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