Android应用标签颜色 [英] Android app label color

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

问题描述

我不希望创建的应用程序标签的任何自定义布局,只是想改变它的颜色为白色(现在是黑色)。我怎么能这样做呢?

 < XML版本=1.0编码=UTF-8&GT?;
<资源的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>
<样式名称=MyTheme的父=@安卓风格/ Theme.Holo.Light>
    <项目名称=机器人:actionBarStyle> @风格/ MyActionBar< /项目>

< /风格>

<样式名称=MyActionBar父=@安卓风格/ Widget.Holo.ActionBar>
    <项目名称=机器人:背景> @可绘制/ bg_blue_solid_onclick< /项目>
//////更改标签颜色
< /风格>
< /资源>
 

解决方案

styles.xml

 <样式名称=MyTheme的父=@安卓风格/ Theme.Holo>
         <项目名称=机器人:actionBarStyle> @风格/ MyActionBar< /项目>

< /风格>
<样式名称=MyActionBar父=@安卓风格/ Widget.Holo.Light.ActionBar>
         <项目名称=机器人:背景>#FF9D21< /项目>
         <项目名称=机器人:titleTextStyle> @风格/ MyActionBarTitleText< /项目>
< /风格>
<样式名称=MyActionBarTitleText
           父=@安卓风格/ TextAppearance.Holo.Widget.ActionBar.Title>
        <项目名称=机器人:文字颜色> @色/红色和LT; /项目>
< /风格>
 

colors.xml

 < XML版本=1.0编码=UTF-8&GT?;
<资源>
    <颜色名称=红>#FF0000< /彩色>
< /资源>
 

有关更多信息

https://developer.android.com/training/basics/actionbar/styling.html#CustomText

编辑:为了使之大胆

 <样式名称=MyActionBarTitleText
           父=@安卓风格/ TextAppearance.Holo.Widget.ActionBar.Title>
        <项目名称=机器人:文字颜色> @色/红色和LT; /项目>
        <项目名称=机器人:TEXTSTYLE>大胆< /项目>
 < /风格>
 

I don't want to create any custom layout for app label, just want to change it's color to white (now it's black). How could I do that?

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/MyActionBar</item>

</style>

<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
    <item name="android:background">@drawable/bg_blue_solid_onclick</item> 
//////CHANGE label color    
</style>
</resources>

解决方案

styles.xml

<style name="MyTheme" parent="@android:style/Theme.Holo">
         <item name="android:actionBarStyle">@style/MyActionBar</item>

</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
         <item name="android:background">#FF9D21</item>
         <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style> 
<style name="MyActionBarTitleText"
           parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@color/red</item>
</style>

colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="red">#FF0000</color>
</resources>

For more info

https://developer.android.com/training/basics/actionbar/styling.html#CustomText

Snap

Edit : For making it bold

 <style name="MyActionBarTitleText"
           parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@color/red</item>
        <item name="android:textStyle">bold</item>
 </style>

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

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