码迷,mamicode.com
首页 > 移动开发 > 详细

更改android actionbar tab文字颜色

时间:2014-08-08 01:51:25      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:android   style   http   color   io   文件   art   ar   

1 在res/values/colors.xml

<color name="text_tab_selected">#000000</color>

<color name="text_tab_unselected">#886C2A</color>


2 /res/color 定义文件 tab.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.androdid.com/apk/res/android"> 
  <item android:state_selected="true" android:color="@color/text_tab_selected" /> 
  <item android:state_active="true" android:color="@color/text_tab_selected"/> 
  <item android:state_selected="false" android:color="@color/text_tab_unselected" />
  <item android:state_active="false" android:color="@color/text_tab_unselected"/>
</selector>

3 res/values/styles.xml

<style name="TabTextColor" parent="@style/Widget.Sherlock.ActionBar.TabText">  
 <item name="android:textColor">@color/tab_text</item>  
</style>

4 在同个文件

style name="Theme.yourTheme" parent="@style/Theme.Sherlock">

<item name="actionBarTabTextStyle">@style/TabTextColor</item>
<item name="android:actionBarTextStyle>@style/TabTextColor</item>

5
来自 http://stackoverflow.com/questions/11393400/tabs-text-custom-color-in-sherlock-action-bar
 
 

更改android actionbar tab文字颜色,布布扣,bubuko.com

更改android actionbar tab文字颜色

标签:android   style   http   color   io   文件   art   ar   

原文地址:http://www.cnblogs.com/chunhuahong/p/3898431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!