设置tabbar上面文字的颜色

//设置tabbar 选中文字的颜色

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:10.0f],

NSForegroundColorAttributeName : [UIColor colorWithRed:63/255.0 green:178/255.0 blue:227/255.0 alpha:1]

} forState:UIControlStateSelected];

//设置tabbar  未选中文字的颜色

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:10.0f],

NSForegroundColorAttributeName : [UIColor colorWithRed:145/255.0 green:158/255.0 blue:180/255.0 alpha:1]

} forState:UIControlStateNormal];

时间: 2024-08-08 05:37:50

设置tabbar上面文字的颜色的相关文章

android textview改变部分文字的颜色和string.xml中文字的替换(转)

转   :http://blog.csdn.net/ljz2009y/article/details/23878669 一:TextView组件改变部分文字的颜色: Java代码   TextView textView = (TextView)findViewById(R.id.textview); //方法一: textView.setText(Html.fromHtml("<font color=\"#ff0000\">红色</font>其它颜色&

JAVA学习绘图颜色及其笔画属性设置字体显示文字

package com.graphics; import java.awt.*; import java.awt.geom.Rectangle2D; import java.util.Date; import javax.swing.*; /** * * @author biexiansheng * */ public class DrawString extends JFrame{ private Shape rect;//矩形对象 private Font font;//字体对象 priva

iOS开发中设置UITextField的占位文字的颜色,和光标的颜色

在iOS开发中,对于很多初学者而言,很有可能碰到需要修改UITextField的占位文字的颜色,以及当UITextField成为第一响应者后光标的颜色,那么下面小编就介绍一下修改占位文字和光标的颜色.1:当你在使用Storyboard开发是,点击UITextField,在点击右上角的属性检测器,其实在这里面你是找不到有可以修改占位文字和光标颜色的属性的.2:那就进入UITextField的协议里面去查找,但是还是找不到,3:在进代理里面去查找,看看有没有通过代理方法,返回颜色并控制占位文字的方法

tabBar中tabBarItem选中颜色自定义设置

1.在storyBoard中,选中tabBarController,设置tabBar如图 2. 直接代码设置 tabBarController.tabBar.selectedImageTintColor = [UIColor orangeColor]; 修改tabBarItem的字体颜色:[tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],NSForegr

iOS开发-- 设置UIButton的文字显示位置、字体的大小、字体的颜色

btn.frame = CGRectMake(x, y, width, height); [btn setTitle: @"search" forState: UIControlStateNormal]; //设置按钮上的自体的大小 //[btn setFont: [UIFont systemFontSize: 14.0]];    //这种可以用来设置字体的大小,但是可能会在将来的SDK版本中去除改方法 //应该使用 btn.titleLabel.font = [UIFont sys

设置UIButton的文字显示位置、字体的大小、字体的颜色、加粗

btn.frame = CGRectMake(x, y, width, height); [btn setTitle: @"search" forState: UIControlStateNormal]; //设置按钮上的自体的大小 //[btn setFont: [UIFont systemFontSize: 14.0]];    //这种可以用来设置字体的大小,但是可能会在将来的SDK版本中去除改方法 //应该使用 btn.titleLabel.font = [UIFont sys

iOS 设置导航栏之二(设置导航栏的颜色、文字的颜色、左边按钮的文字及颜色)

                  #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end #import "AppDelegate.h" #import "KeyViewController.h" @interface Ap

iOS 设置导航栏的颜色和导航栏上文字的颜色

#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end #import "AppDelegate.h" #import "KeyViewController.h" @interface AppDelegate () @end

iOS设置导航与其标题的颜色及字体大小和系统默认TabBar的相关设置与使用方法

第一步: //在info.plist中添加一个字段:view controller -base status bar 设置为NO://导航颜色[[UINavigationBar appearance] setBarTintColor:[UIColor XXXX]];[[UITableViewCell appearance] setBackgroundColor:[UIColor XXXX]]; //设置状态栏(信号区)白色[[UIApplication sharedApplication] se