Skip to content

Commit

Permalink
1.把tabbar的字体的颜色红定义了一下`
Browse files Browse the repository at this point in the history
  • Loading branch information
zhufengyi committed Jun 30, 2015
1 parent b6ce79a commit bef6e00
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 1,2 @@
# ZFYTabbarController
使用方法:
2 changes: 1 addition & 1 deletion TabBar/BaseNavigationViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@ @implementation BaseNavigationViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationBar.barTintColor =[UIColor redColor];
self.navigationBar.barTintColor =[UIColor whiteColor];
//防止手势失效的解决方案
self.delegate=self;
self.interactivePopGestureRecognizer.delegate=self;
Expand Down
10 changes: 8 additions & 2 deletions TabBar/CustomController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 12,12 @@
#import "BaseNavigationViewController.h"
#import "ThirdViewController.h"
#import "UIImage Color.h"

// 字体设置
#define TITLE_NORMAL_COLOR [UIColor colorWithRed:20/255.0 green:20/255.0 blue:120/255.0 alpha:1]
#define TITLE_SELECTED_COLOR [UIColor colorWithRed:20/255.0 green:152/255.0 blue:172/255.0 alpha:1]
#define TITLE_FONT [UIFont fontWithName:@"AmericanTypewriter" size:14.0f]

@interface CustomController ()

@end
Expand Down Expand Up @@ -39,8 45,8 @@ - (void)viewDidLoad {
}
self.viewControllers=navigationArray;
UITabBarItem *item = [UITabBarItem appearance];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor purpleColor], NSFontAttributeName:[UIFont fontWithName:@"AmericanTypewriter" size:14.0f]} forState:UIControlStateNormal];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:20/255.0 green:152/255.0 blue:172/255.0 alpha:1], NSFontAttributeName:[UIFont fontWithName:@"AmericanTypewriter" size:14.0f]} forState:UIControlStateSelected];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName:TITLE_NORMAL_COLOR, NSFontAttributeName:TITLE_FONT} forState:UIControlStateNormal];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName:TITLE_SELECTED_COLOR, NSFontAttributeName:TITLE_FONT} forState:UIControlStateSelected];
//设置选择后的高亮
//self.tabBar.selectionIndicatorImage =[UIImage imageNamed:@"[email protected]"];
//设置背景
Expand Down
Binary file not shown.

0 comments on commit bef6e00

Please sign in to comment.