├── .DS_Store ├── Class ├── .DS_Store ├── FriendVC.h ├── FriendVC.m ├── MainVC.h ├── MainVC.m ├── MeVC.h ├── MeVC.m ├── MsgVC.h └── MsgVC.m ├── DEMO.PNG ├── Image ├── .DS_Store ├── find_tabbar@2x.png ├── find_tabbar@3x.png ├── find_tabbar_sel@2x.png ├── find_tabbar_sel@3x.png ├── friend_tabbar@2x.png ├── friend_tabbar@3x.png ├── friend_tabbar_sel@2x.png ├── friend_tabbar_sel@3x.png ├── home_tabbar@2x.png ├── home_tabbar@3x.png ├── home_tabbar_sel@2x.png ├── home_tabbar_sel@3x.png ├── me_tabbar@2x.png ├── me_tabbar@3x.png ├── me_tabbar_sel@2x.png ├── me_tabbar_sel@3x.png ├── msg_tabbar@2x.png ├── msg_tabbar@3x.png ├── msg_tabbar_sel@2x.png └── msg_tabbar_sel@3x.png ├── LICENSE ├── README.md ├── XHTabBar.podspec ├── XHTabBar ├── .DS_Store ├── XHTabBar.h └── XHTabBar.m ├── XHTabBarExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── xiaohui.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── zhuxiaohui.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── xiaohui.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── XHTabBarExample.xcscheme │ │ └── xcschememanagement.plist │ └── zhuxiaohui.xcuserdatad │ └── xcschemes │ ├── XHTabBarExample.xcscheme │ └── xcschememanagement.plist └── XHTabBarExample ├── .DS_Store ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj └── LaunchScreen.storyboard ├── Image └── .DS_Store ├── Info.plist └── main.m /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/.DS_Store -------------------------------------------------------------------------------- /Class/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Class/.DS_Store -------------------------------------------------------------------------------- /Class/FriendVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // FriendVC.h 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FriendVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Class/FriendVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // FriendVC.m 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import "FriendVC.h" 10 | 11 | @interface FriendVC () 12 | 13 | @end 14 | 15 | @implementation FriendVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.navigationItem.title = @"朋友"; 20 | self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; 21 | // Do any additional setup after loading the view. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | /* 30 | #pragma mark - Navigation 31 | 32 | // In a storyboard-based application, you will often want to do a little preparation before navigation 33 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 34 | // Get the new view controller using [segue destinationViewController]. 35 | // Pass the selected object to the new view controller. 36 | } 37 | */ 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Class/MainVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainVC.h 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Class/MainVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainVC.m 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import "MainVC.h" 10 | #import "MsgVC.h" 11 | @interface MainVC () 12 | 13 | @end 14 | 15 | @implementation MainVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.navigationItem.title = @"首页"; 20 | self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; 21 | 22 | [self initUI]; 23 | 24 | // Do any additional setup after loading the view. 25 | } 26 | -(void)initUI 27 | { 28 | UIButton *pushBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 29 | pushBtn.backgroundColor = [UIColor orangeColor]; 30 | [pushBtn setTitle:@"Push" forState:UIControlStateNormal]; 31 | pushBtn.frame = CGRectMake(self.view.frame.size.width/2.0-40.0, self.view.frame.size.height/2.0-20.0, 80.0, 40.0); 32 | [pushBtn addTarget:self action:@selector(push) forControlEvents:UIControlEventTouchUpInside]; 33 | [self.view addSubview:pushBtn]; 34 | } 35 | -(void)push 36 | { 37 | MsgVC *VC = [[MsgVC alloc] init]; 38 | VC.hidesBottomBarWhenPushed = YES; 39 | [self.navigationController pushViewController:VC animated:YES]; 40 | } 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | // Dispose of any resources that can be recreated. 44 | } 45 | 46 | /* 47 | #pragma mark - Navigation 48 | 49 | // In a storyboard-based application, you will often want to do a little preparation before navigation 50 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 51 | // Get the new view controller using [segue destinationViewController]. 52 | // Pass the selected object to the new view controller. 53 | } 54 | */ 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Class/MeVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // MeVC.h 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MeVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Class/MeVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // MeVC.m 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import "MeVC.h" 10 | 11 | @interface MeVC () 12 | 13 | @end 14 | 15 | @implementation MeVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.navigationItem.title = @"我的"; 20 | self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; 21 | // Do any additional setup after loading the view. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | /* 30 | #pragma mark - Navigation 31 | 32 | // In a storyboard-based application, you will often want to do a little preparation before navigation 33 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 34 | // Get the new view controller using [segue destinationViewController]. 35 | // Pass the selected object to the new view controller. 36 | } 37 | */ 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Class/MsgVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // MsgVC.h 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MsgVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Class/MsgVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // MsgVC.m 3 | // XHTabBar-Demo 4 | // 5 | // Created by xiaohui on 16/2/26. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import "MsgVC.h" 10 | #import "XHTabBar.h" 11 | @interface MsgVC () 12 | 13 | @end 14 | 15 | @implementation MsgVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.navigationItem.title = @"消息"; 20 | self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; 21 | 22 | // Do any additional setup after loading the view. 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | /* 31 | #pragma mark - Navigation 32 | 33 | // In a storyboard-based application, you will often want to do a little preparation before navigation 34 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 35 | // Get the new view controller using [segue destinationViewController]. 36 | // Pass the selected object to the new view controller. 37 | } 38 | */ 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DEMO.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/DEMO.PNG -------------------------------------------------------------------------------- /Image/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/.DS_Store -------------------------------------------------------------------------------- /Image/find_tabbar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/find_tabbar@2x.png -------------------------------------------------------------------------------- /Image/find_tabbar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/find_tabbar@3x.png -------------------------------------------------------------------------------- /Image/find_tabbar_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/find_tabbar_sel@2x.png -------------------------------------------------------------------------------- /Image/find_tabbar_sel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/find_tabbar_sel@3x.png -------------------------------------------------------------------------------- /Image/friend_tabbar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/friend_tabbar@2x.png -------------------------------------------------------------------------------- /Image/friend_tabbar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/friend_tabbar@3x.png -------------------------------------------------------------------------------- /Image/friend_tabbar_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/friend_tabbar_sel@2x.png -------------------------------------------------------------------------------- /Image/friend_tabbar_sel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/friend_tabbar_sel@3x.png -------------------------------------------------------------------------------- /Image/home_tabbar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/home_tabbar@2x.png -------------------------------------------------------------------------------- /Image/home_tabbar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/home_tabbar@3x.png -------------------------------------------------------------------------------- /Image/home_tabbar_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/home_tabbar_sel@2x.png -------------------------------------------------------------------------------- /Image/home_tabbar_sel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/home_tabbar_sel@3x.png -------------------------------------------------------------------------------- /Image/me_tabbar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/me_tabbar@2x.png -------------------------------------------------------------------------------- /Image/me_tabbar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/me_tabbar@3x.png -------------------------------------------------------------------------------- /Image/me_tabbar_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/me_tabbar_sel@2x.png -------------------------------------------------------------------------------- /Image/me_tabbar_sel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/me_tabbar_sel@3x.png -------------------------------------------------------------------------------- /Image/msg_tabbar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/msg_tabbar@2x.png -------------------------------------------------------------------------------- /Image/msg_tabbar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/msg_tabbar@3x.png -------------------------------------------------------------------------------- /Image/msg_tabbar_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/msg_tabbar_sel@2x.png -------------------------------------------------------------------------------- /Image/msg_tabbar_sel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/Image/msg_tabbar_sel@3x.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 XHTabBar (https://github.com/CoderZhuXH/XHTabBar) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XHTabBar 2 | #### 快速创建自定义TabBar,支持小红点,数字角标及自定义高度
3 | 4 | [![AppVeyor](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg?maxAge=2592000)](https://github.com/CoderZhuXH/XHTabBar) 5 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/CoderZhuXH/XHTabBar) 6 | [![Version Status](https://img.shields.io/cocoapods/v/XHTabBar.svg?style=flat)](http://cocoadocs.org/docsets/XHTabBar) 7 | [![Support](https://img.shields.io/badge/support-iOS%207%2B-brightgreen.svg)](https://github.com/CoderZhuXH/XHTabBar) 8 | [![Pod Platform](https://img.shields.io/cocoapods/p/XHTabBar.svg?style=flat)](http://cocoadocs.org/docsets/XHTabBar) 9 | [![Pod License](https://img.shields.io/cocoapods/l/XHTabBar.svg?style=flat)](https://github.com/CoderZhuXH/XHTabBar/blob/master/LICENSE) 10 | 11 | ============== 12 | 13 | #### Swift版请戳这里>>> https://github.com/CoderZhuXH/XHTabBarSwift 14 | ###技术交流群(群号:537476189). 15 | ## 效果 16 | ![image](https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/master/DEMO.PNG) 17 | 18 | ## 使用方法 19 | ### 1.在Appdelegate 中初始化,并设置为根控制器 20 | ```objc 21 | //控制器数组 22 | NSArray *controllerArray = @[@"MainVC",@"MsgVC",@"FriendVC",@"MeVC"]; 23 | //title数组 24 | NSArray * titleArray = @[@"首页",@"消息",@"朋友",@"我的"]; 25 | //默认图片数组 26 | NSArray *imageArray= @[@"home_tabbar",@"msg_tabbar",@"friend_tabbar",@"me_tabbar"]; 27 | //选中图片数组 28 | NSArray *selImageArray = @[@"home_tabbar_sel",@"msg_tabbar_sel",@"friend_tabbar_sel",@"me_tabbar_sel"]; 29 | //tabBar高度 30 | CGFloat tabBarHeight = 49.0; 31 | 32 | //初始化(height:最小高度为49.0,当传nil 或<49.0时均按49.0处理) 33 | XHTabBar *tabbar = [[XHTabBar alloc] initWithControllerArray:controllerArray titleArray:titleArray imageArray:imageArray selImageArray:selImageArray height:tabBarHeight]; 34 | 35 | //设置为根控制器 36 | self.window.rootViewController = tabbar; 37 | ``` 38 | ### 2.点击代理 39 | ```objc 40 | 41 | /** 42 | tabBar 点击事件回调 43 | 44 | @param tabBar tabBar 45 | @param viewController 选中的viewController 46 | */ 47 | -(void)xhTabBar:(XHTabBar *)tabBar didSelectViewController:(UIViewController *)viewController; 48 | 49 | ``` 50 | 51 | ### 3.影藏tabBar 52 | ```objc 53 | //push界面时,若需影藏tabBar,调用系统方法设置影藏即可,如下 54 | MsgVC *VC = [[MsgVC alloc] init]; 55 | VC.hidesBottomBarWhenPushed = YES; 56 | [self.navigationController pushViewController:VC animated:YES]; 57 | ``` 58 | ### 4.角标、小红点及其他设置接口 59 | ```objc 60 | /** 61 | * 设置tabBar显示指定控制器 62 | * 63 | * @param index 位置 64 | */ 65 | -(void)showControllerIndex:(NSInteger)index; 66 | 67 | /** 68 | * 数字角标 69 | * 70 | * @param num 所要显示数字 71 | * @param index 位置 72 | */ 73 | -(void)showBadgeMark:(NSInteger)badge index:(NSInteger)index; 74 | 75 | /** 76 | * 小红点 77 | * 78 | * @param index 位置 79 | */ 80 | -(void)showPointMarkIndex:(NSInteger)index; 81 | 82 | /** 83 | * 影藏指定位置角标 84 | * 85 | * @param index 位置 86 | */ 87 | -(void)hideMarkIndex:(NSInteger)index; 88 | ``` 89 | ### 5.定义tabbar文字大小,颜色,请在XHTabBar.m 顶部修改下面宏定义 90 | ```objc 91 | //RGB颜色 92 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1] 93 | //title默认颜色 94 | #define TitleColor [UIColor grayColor] 95 | //title选中颜色 96 | #define TitleColor_Sel RGBCOLOR(41, 167, 245) 97 | //title字体大小 98 | #define TitleFontSize 12.0 99 | //TabBar背景色 100 | #define TabBarBackgroundColor [UIColor whiteColor] 101 | 102 | //数字角标直径 103 | #define NumMark_W_H 20 104 | //小红点直径 105 | #define PointMark_W_H 12 106 | ``` 107 | ## 安装 108 | ### 手动添加:
109 | * 1.将 XHTabBar 文件夹添加到工程目录中
110 | * 2.导入 XHTabBar.h 111 | 112 | ### CocoaPods:
113 | * 1.在 Podfile 中添加 pod 'XHTabBar'
114 | * 2.执行 pod install 或 pod update
115 | * 3.导入 XHTabBar.h 116 | 117 | ### Tips 118 | * 1.如果发现pod search XHTabBar 搜索出来的不是最新版本,需要在终端执行cd desktop退回到desktop,然后执行pod setup命令更新本地spec缓存(需要几分钟),然后再搜索就可以了 119 | * 2.如果你发现你执行pod install后,导入的不是最新版本,请删除Podfile.lock文件,在执行一次 pod install 120 | 121 | ## 系统要求 122 | * 该项目最低支持 iOS 7.0 和 Xcode 7.0 123 | 124 | ## 许可证 125 | XHTabBar 使用 MIT 许可证,详情见 LICENSE 文件 -------------------------------------------------------------------------------- /XHTabBar.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "XHTabBar" 3 | s.version = "1.5.5" 4 | s.summary = "快速创建自定义TabBar,支持小红点,数字角标及自定义高度" 5 | s.homepage = "https://github.com/CoderZhuXH/XHTabBar" 6 | s.license = { :type => "MIT", :file => "LICENSE" } 7 | s.authors = { "Zhu Xiaohui" => "977950862@qq.com"} 8 | s.platform = :ios, "7.0" 9 | s.source = { :git => "https://github.com/CoderZhuXH/XHTabBar.git", :tag => s.version } 10 | s.source_files = "XHTabBar", "*.{h,m}" 11 | s.requires_arc = true 12 | end 13 | -------------------------------------------------------------------------------- /XHTabBar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/XHTabBar/.DS_Store -------------------------------------------------------------------------------- /XHTabBar/XHTabBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHTabBar.h 3 | // XHTabBarExample 4 | // 5 | // Created by xiaohui on 15-4-8. 6 | // Copyright © 2015年 qiantou. All rights reserved. 7 | // https://github.com/CoderZhuXH/XHTabBar 8 | 9 | #import 10 | 11 | 12 | @interface XHTabBarButton : UIButton 13 | 14 | @end 15 | 16 | @class XHTabBar; 17 | @protocol XHTabBarDelegate 18 | @optional 19 | 20 | /** 21 | tabBar 点击事件回调 22 | 23 | @param tabBar tabBar 24 | @param viewController 选中的viewController 25 | */ 26 | -(void)xhTabBar:(XHTabBar *)tabBar didSelectViewController:(UIViewController *)viewController; 27 | 28 | @end 29 | 30 | @interface XHTabBar : UITabBarController 31 | 32 | @property(nonatomic,assign) idxhTabBarDelegate; 33 | 34 | 35 | /** 36 | * 初始化 37 | * 38 | * @param controllerArray 控制器数组 39 | * @param titleArray 标题数组 40 | * @param imageArray 图片数组 41 | * @param selImageArray 选中图片数组 42 | * @param height tabBar 高度(传nil或<49.0均按49.0处理)) 43 | * 44 | * @return self 45 | */ 46 | - (instancetype)initWithControllerArray:(NSArray *)controllerArray titleArray:(NSArray *)titleArray imageArray:(NSArray *)imageArray selImageArray:(NSArray *)selImageArray height:(CGFloat )height; 47 | 48 | /* 49 | 影藏TabBar 调用系统方法 50 | VC.hidesBottomBarWhenPushed = YES; 51 | */ 52 | 53 | /** 54 | * 设置tabBar显示指定控制器 55 | * 56 | * @param index 位置 57 | */ 58 | -(void)showControllerIndex:(NSInteger)index; 59 | 60 | /** 61 | * 数字角标 62 | * 63 | * @param num 所要显示数字 64 | * @param index 位置 65 | */ 66 | -(void)showBadgeMark:(NSInteger)badge index:(NSInteger)index; 67 | 68 | /** 69 | * 小红点 70 | * 71 | * @param index 位置 72 | */ 73 | -(void)showPointMarkIndex:(NSInteger)index; 74 | 75 | /** 76 | * 影藏指定位置角标 77 | * 78 | * @param index 位置 79 | */ 80 | -(void)hideMarkIndex:(NSInteger)index; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /XHTabBar/XHTabBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHTabBar.m 3 | // XHTabBarExample 4 | // 5 | // Created by xiaohui on 15-4-8. 6 | // Copyright © 2015年 qiantou. All rights reserved. 7 | // https://github.com/CoderZhuXH/XHTabBar 8 | 9 | #import "XHTabBar.h" 10 | 11 | //RGB颜色 12 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1] 13 | //title默认颜色 14 | #define TitleColor [UIColor grayColor] 15 | //title选中颜色 16 | #define TitleColor_Sel RGBCOLOR(41, 167, 245) 17 | //title字体大小 18 | #define TitleFontSize 12.0 19 | //TabBar背景色 20 | #define TabBarBackgroundColor [UIColor whiteColor] 21 | 22 | //数字角标直径 23 | #define NumMark_W_H 20 24 | //小红点直径 25 | #define PointMark_W_H 12 26 | 27 | 28 | //TabBarButton中 图片与文字上下所占比 29 | static const float scale=0.55; 30 | 31 | #pragma mark-@interface XHTabBarButton 32 | @interface XHTabBarButton() 33 | 34 | @end 35 | 36 | @implementation XHTabBarButton 37 | 38 | - (id)initWithFrame:(CGRect)frame 39 | { 40 | self = [super initWithFrame:frame]; 41 | if (self) { 42 | 43 | self.imageView.contentMode = UIViewContentModeScaleAspectFit; 44 | self.titleLabel.textAlignment = NSTextAlignmentCenter; 45 | self.backgroundColor = TabBarBackgroundColor; 46 | } 47 | 48 | return self; 49 | } 50 | -(CGRect)imageRectForContentRect:(CGRect)contentRect{ 51 | 52 | CGFloat newX = 0; 53 | CGFloat newY =5; 54 | CGFloat newWidth = contentRect.size.width; 55 | CGFloat newHeight = contentRect.size.height*scale-newY; 56 | return CGRectMake(newX, newY, newWidth, newHeight); 57 | } 58 | - (CGRect)titleRectForContentRect:(CGRect)contentRect{ 59 | 60 | CGFloat newX = 0; 61 | CGFloat newY = contentRect.size.height*scale; 62 | CGFloat newWidth = contentRect.size.width; 63 | CGFloat newHeight = contentRect.size.height-contentRect.size.height*scale; 64 | return CGRectMake(newX, newY, newWidth, newHeight); 65 | } 66 | 67 | @end 68 | 69 | #pragma mark-@interface XHTabBar 70 | @interface XHTabBar () 71 | @property(nonatomic,strong)UIButton *seleBtn; 72 | @property(nonatomic,strong)UIView *tabBarView; 73 | @property(nonatomic,assign)CGFloat tabBarHeight; 74 | @property(nonatomic,strong)NSArray *titleArray; 75 | @property(nonatomic,strong)NSArray *imageArray; 76 | @property(nonatomic,strong)NSArray *selImageArray; 77 | @property(nonatomic,strong)NSArray *controllerArray; 78 | @end 79 | @implementation XHTabBar 80 | - (instancetype)init 81 | { 82 | self = [super init]; 83 | if (self) { 84 | 85 | [self initData]; 86 | [self initTabBar]; 87 | } 88 | return self; 89 | } 90 | - (instancetype)initWithControllerArray:(NSArray *)controllerArray titleArray:(NSArray *)titleArray imageArray:(NSArray *)imageArray selImageArray:(NSArray *)selImageArray height:(CGFloat )height 91 | { 92 | self = [super init]; 93 | if (self) { 94 | 95 | self.controllerArray =controllerArray; 96 | self.titleArray = titleArray; 97 | self.imageArray = imageArray; 98 | self.selImageArray = selImageArray; 99 | self.tabBarHeight = height; 100 | 101 | [self initTabBar]; 102 | 103 | } 104 | return self; 105 | } 106 | /** 107 | * 若想外部代码更简洁,可调alloc init 初始化tabbar : XHTabBar *tabbar = [[XHTabBar alloc] init];但必须在这里初始化相关数据,如下: 108 | */ 109 | -(void)initData 110 | { 111 | /* 112 | //控制器数组(不需要导入控制器头文件) 113 | self.controllerArray = @[@"MainVC",@"MsgVC",@"FriendVC",@"MeVC"]; 114 | //title数组 115 | self.titleArray = @[@"首页",@"消息",@"朋友",@"我的"]; 116 | //默认图片数组 117 | self.imageArray = @[@"home_tabbar",@"msg_tabbar",@"friend_tabbar",@"me_tabbar"]; 118 | //选中图片数组 119 | self.selImageArray = @[@"home_tabbar_sel",@"msg_tabbar_sel",@"friend_tabbar_sel",@"me_tabbar_sel"]; 120 | //tabBar高度 121 | self.tabBarHeight = 49.0; 122 | */ 123 | } 124 | -(void)initTabBar{ 125 | 126 | //创建VC 127 | [self createControllerBycontrollerArrayay:self.controllerArray]; 128 | //创建tabBarView 129 | [self createTabBarView]; 130 | //设置TabbarLine 131 | [self setTabBarLine]; 132 | } 133 | 134 | -(void)createControllerBycontrollerArrayay:(NSArray *)controllerArrayay 135 | { 136 | if(controllerArrayay.count==0) NSLog(@"控制器数组为nil,请初始化"); 137 | NSMutableArray *tabBarArr = [[NSMutableArray alloc]init]; 138 | for (NSString *className in controllerArrayay) { 139 | Class class = NSClassFromString(className); 140 | UIViewController *viewcontroller = [[class alloc]init]; 141 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewcontroller]; 142 | [tabBarArr addObject:nav]; 143 | 144 | } 145 | self.viewControllers = tabBarArr; 146 | } 147 | -(void)setTabBarLine 148 | { 149 | if (self.tabBarHeight>49.0) 150 | { 151 | [self.tabBar setShadowImage:[[UIImage alloc] init]]; 152 | [self.tabBar setBackgroundImage:[[UIImage alloc] init]]; 153 | 154 | UILabel *lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 0.5)]; 155 | lineLabel.backgroundColor = [UIColor lightGrayColor]; 156 | [self.tabBarView addSubview:lineLabel]; 157 | } 158 | } 159 | -(void)createTabBarView 160 | { 161 | if(!self.tabBarHeight||self.tabBarHeight<49.0) self.tabBarHeight=49.0; 162 | 163 | self.tabBarView = [[UIView alloc] initWithFrame:CGRectMake(0,49.0-self.tabBarHeight,[UIScreen mainScreen].bounds.size.width,self.tabBarHeight)]; 164 | 165 | 166 | [self.tabBar addSubview:self.tabBarView]; 167 | 168 | if(self.selImageArray.count==0) NSLog(@"选中图片数组为nil,请初始化"); 169 | if(self.imageArray.count==0) NSLog(@"图片数组为nil,请初始化"); 170 | if(self.titleArray.count==0) NSLog(@"title数组为nil,请初始化"); 171 | 172 | int num = (int)self.controllerArray.count; 173 | for(int i=0;i= self.controllerArray.count) 223 | { 224 | NSLog(@"index取值超出范围"); 225 | return; 226 | } 227 | 228 | self.seleBtn.selected = NO; 229 | UIButton *button = (UIButton *)[self.tabBarView viewWithTag:1000+index]; 230 | button.selected = YES; 231 | self.seleBtn = button; 232 | self.selectedIndex=index; 233 | 234 | if([self.xhTabBarDelegate respondsToSelector:@selector(xhTabBar:didSelectViewController:)]) 235 | { 236 | [self.xhTabBarDelegate xhTabBar:self didSelectViewController:self.viewControllers[index]]; 237 | } 238 | } 239 | /** 240 | * 数字角标 241 | * 242 | * @param num 所要显示数字 243 | * @param index 位置 244 | */ 245 | -(void)showBadgeMark:(NSInteger)badge index:(NSInteger)index 246 | { 247 | if(index >= self.controllerArray.count) 248 | { 249 | NSLog(@"index取值超出范围"); 250 | return; 251 | } 252 | 253 | UILabel *numLabel = (UILabel *)[self.tabBarView viewWithTag:1010+index]; 254 | numLabel.hidden=NO; 255 | CGRect nFrame = numLabel.frame; 256 | if(badge<=0) 257 | { 258 | //隐藏角标 259 | [self hideMarkIndex:index]; 260 | } 261 | else 262 | { 263 | if(badge>0&&badge<=9) 264 | { 265 | nFrame.size.width = NumMark_W_H; 266 | } 267 | else if (badge>9&&badge<=19) 268 | { 269 | nFrame.size.width = NumMark_W_H+5; 270 | } 271 | else 272 | { 273 | nFrame.size.width = NumMark_W_H+10; 274 | } 275 | nFrame.size.height = NumMark_W_H; 276 | numLabel.frame = nFrame; 277 | numLabel.layer.cornerRadius = NumMark_W_H/2.0; 278 | numLabel.text = [NSString stringWithFormat:@"%ld",badge]; 279 | if(badge>99) 280 | { 281 | numLabel.text =@"99+"; 282 | } 283 | } 284 | } 285 | 286 | /** 287 | * 小红点 288 | * 289 | * @param index 位置 290 | */ 291 | -(void)showPointMarkIndex:(NSInteger)index 292 | { 293 | if(index >= self.controllerArray.count) 294 | { 295 | NSLog(@"index取值超出范围"); 296 | return; 297 | } 298 | UILabel *numLabel = (UILabel *)[self.tabBarView viewWithTag:1010+index]; 299 | numLabel.hidden=NO; 300 | CGRect nFrame = numLabel.frame; 301 | nFrame.size.height=PointMark_W_H; 302 | nFrame.size.width = PointMark_W_H; 303 | numLabel.frame = nFrame; 304 | numLabel.layer.cornerRadius = PointMark_W_H/2.0; 305 | numLabel.text = @""; 306 | } 307 | 308 | /** 309 | * 影藏指定位置角标 310 | * 311 | * @param index 位置 312 | */ 313 | -(void)hideMarkIndex:(NSInteger)index 314 | { 315 | if(index >= self.controllerArray.count) 316 | { 317 | NSLog(@"index取值超出范围"); 318 | return; 319 | } 320 | 321 | UILabel *numLabel = (UILabel *)[self.tabBarView viewWithTag:1010+index]; 322 | numLabel.hidden = YES; 323 | } 324 | @end 325 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4B2397D01C81953100F155F3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2397CF1C81953100F155F3 /* main.m */; }; 11 | 4B2397D31C81953100F155F3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2397D21C81953100F155F3 /* AppDelegate.m */; }; 12 | 4B2397D51C81953100F155F3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B2397D41C81953100F155F3 /* Assets.xcassets */; }; 13 | 4B2397D81C81953100F155F3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B2397D61C81953100F155F3 /* LaunchScreen.storyboard */; }; 14 | 4BA7E6C11CEC027C00F76507 /* XHTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA7E6BE1CEC027C00F76507 /* XHTabBar.m */; }; 15 | 4BA7E6CC1CEC02A600F76507 /* FriendVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA7E6C51CEC02A600F76507 /* FriendVC.m */; }; 16 | 4BA7E6CD1CEC02A600F76507 /* MainVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA7E6C71CEC02A600F76507 /* MainVC.m */; }; 17 | 4BA7E6CE1CEC02A600F76507 /* MeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA7E6C91CEC02A600F76507 /* MeVC.m */; }; 18 | 4BA7E6CF1CEC02A600F76507 /* MsgVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA7E6CB1CEC02A600F76507 /* MsgVC.m */; }; 19 | 4BA7E6E51CEC02AB00F76507 /* find_tabbar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D11CEC02AB00F76507 /* find_tabbar@2x.png */; }; 20 | 4BA7E6E61CEC02AB00F76507 /* find_tabbar@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D21CEC02AB00F76507 /* find_tabbar@3x.png */; }; 21 | 4BA7E6E71CEC02AB00F76507 /* find_tabbar_sel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D31CEC02AB00F76507 /* find_tabbar_sel@2x.png */; }; 22 | 4BA7E6E81CEC02AB00F76507 /* find_tabbar_sel@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D41CEC02AB00F76507 /* find_tabbar_sel@3x.png */; }; 23 | 4BA7E6E91CEC02AB00F76507 /* friend_tabbar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D51CEC02AB00F76507 /* friend_tabbar@2x.png */; }; 24 | 4BA7E6EA1CEC02AB00F76507 /* friend_tabbar@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D61CEC02AB00F76507 /* friend_tabbar@3x.png */; }; 25 | 4BA7E6EB1CEC02AB00F76507 /* friend_tabbar_sel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D71CEC02AB00F76507 /* friend_tabbar_sel@2x.png */; }; 26 | 4BA7E6EC1CEC02AB00F76507 /* friend_tabbar_sel@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D81CEC02AB00F76507 /* friend_tabbar_sel@3x.png */; }; 27 | 4BA7E6ED1CEC02AB00F76507 /* home_tabbar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6D91CEC02AB00F76507 /* home_tabbar@2x.png */; }; 28 | 4BA7E6EE1CEC02AB00F76507 /* home_tabbar@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6DA1CEC02AB00F76507 /* home_tabbar@3x.png */; }; 29 | 4BA7E6EF1CEC02AB00F76507 /* home_tabbar_sel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6DB1CEC02AB00F76507 /* home_tabbar_sel@2x.png */; }; 30 | 4BA7E6F01CEC02AB00F76507 /* home_tabbar_sel@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6DC1CEC02AB00F76507 /* home_tabbar_sel@3x.png */; }; 31 | 4BA7E6F11CEC02AB00F76507 /* me_tabbar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6DD1CEC02AB00F76507 /* me_tabbar@2x.png */; }; 32 | 4BA7E6F21CEC02AB00F76507 /* me_tabbar@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6DE1CEC02AB00F76507 /* me_tabbar@3x.png */; }; 33 | 4BA7E6F31CEC02AB00F76507 /* me_tabbar_sel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6DF1CEC02AB00F76507 /* me_tabbar_sel@2x.png */; }; 34 | 4BA7E6F41CEC02AB00F76507 /* me_tabbar_sel@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6E01CEC02AB00F76507 /* me_tabbar_sel@3x.png */; }; 35 | 4BA7E6F51CEC02AB00F76507 /* msg_tabbar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6E11CEC02AB00F76507 /* msg_tabbar@2x.png */; }; 36 | 4BA7E6F61CEC02AB00F76507 /* msg_tabbar@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6E21CEC02AB00F76507 /* msg_tabbar@3x.png */; }; 37 | 4BA7E6F71CEC02AB00F76507 /* msg_tabbar_sel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6E31CEC02AB00F76507 /* msg_tabbar_sel@2x.png */; }; 38 | 4BA7E6F81CEC02AB00F76507 /* msg_tabbar_sel@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BA7E6E41CEC02AB00F76507 /* msg_tabbar_sel@3x.png */; }; 39 | /* End PBXBuildFile section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 4B2397CB1C81953100F155F3 /* XHTabBarExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XHTabBarExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 4B2397CF1C81953100F155F3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 4B2397D11C81953100F155F3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 4B2397D21C81953100F155F3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 4B2397D41C81953100F155F3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 4B2397D71C81953100F155F3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 4B2397D91C81953100F155F3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 4BA7E6BD1CEC027C00F76507 /* XHTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHTabBar.h; sourceTree = ""; }; 50 | 4BA7E6BE1CEC027C00F76507 /* XHTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHTabBar.m; sourceTree = ""; }; 51 | 4BA7E6C41CEC02A600F76507 /* FriendVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FriendVC.h; sourceTree = ""; }; 52 | 4BA7E6C51CEC02A600F76507 /* FriendVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FriendVC.m; sourceTree = ""; }; 53 | 4BA7E6C61CEC02A600F76507 /* MainVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainVC.h; sourceTree = ""; }; 54 | 4BA7E6C71CEC02A600F76507 /* MainVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainVC.m; sourceTree = ""; }; 55 | 4BA7E6C81CEC02A600F76507 /* MeVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MeVC.h; sourceTree = ""; }; 56 | 4BA7E6C91CEC02A600F76507 /* MeVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MeVC.m; sourceTree = ""; }; 57 | 4BA7E6CA1CEC02A600F76507 /* MsgVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MsgVC.h; sourceTree = ""; }; 58 | 4BA7E6CB1CEC02A600F76507 /* MsgVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MsgVC.m; sourceTree = ""; }; 59 | 4BA7E6D11CEC02AB00F76507 /* find_tabbar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "find_tabbar@2x.png"; sourceTree = ""; }; 60 | 4BA7E6D21CEC02AB00F76507 /* find_tabbar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "find_tabbar@3x.png"; sourceTree = ""; }; 61 | 4BA7E6D31CEC02AB00F76507 /* find_tabbar_sel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "find_tabbar_sel@2x.png"; sourceTree = ""; }; 62 | 4BA7E6D41CEC02AB00F76507 /* find_tabbar_sel@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "find_tabbar_sel@3x.png"; sourceTree = ""; }; 63 | 4BA7E6D51CEC02AB00F76507 /* friend_tabbar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "friend_tabbar@2x.png"; sourceTree = ""; }; 64 | 4BA7E6D61CEC02AB00F76507 /* friend_tabbar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "friend_tabbar@3x.png"; sourceTree = ""; }; 65 | 4BA7E6D71CEC02AB00F76507 /* friend_tabbar_sel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "friend_tabbar_sel@2x.png"; sourceTree = ""; }; 66 | 4BA7E6D81CEC02AB00F76507 /* friend_tabbar_sel@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "friend_tabbar_sel@3x.png"; sourceTree = ""; }; 67 | 4BA7E6D91CEC02AB00F76507 /* home_tabbar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "home_tabbar@2x.png"; sourceTree = ""; }; 68 | 4BA7E6DA1CEC02AB00F76507 /* home_tabbar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "home_tabbar@3x.png"; sourceTree = ""; }; 69 | 4BA7E6DB1CEC02AB00F76507 /* home_tabbar_sel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "home_tabbar_sel@2x.png"; sourceTree = ""; }; 70 | 4BA7E6DC1CEC02AB00F76507 /* home_tabbar_sel@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "home_tabbar_sel@3x.png"; sourceTree = ""; }; 71 | 4BA7E6DD1CEC02AB00F76507 /* me_tabbar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "me_tabbar@2x.png"; sourceTree = ""; }; 72 | 4BA7E6DE1CEC02AB00F76507 /* me_tabbar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "me_tabbar@3x.png"; sourceTree = ""; }; 73 | 4BA7E6DF1CEC02AB00F76507 /* me_tabbar_sel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "me_tabbar_sel@2x.png"; sourceTree = ""; }; 74 | 4BA7E6E01CEC02AB00F76507 /* me_tabbar_sel@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "me_tabbar_sel@3x.png"; sourceTree = ""; }; 75 | 4BA7E6E11CEC02AB00F76507 /* msg_tabbar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "msg_tabbar@2x.png"; sourceTree = ""; }; 76 | 4BA7E6E21CEC02AB00F76507 /* msg_tabbar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "msg_tabbar@3x.png"; sourceTree = ""; }; 77 | 4BA7E6E31CEC02AB00F76507 /* msg_tabbar_sel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "msg_tabbar_sel@2x.png"; sourceTree = ""; }; 78 | 4BA7E6E41CEC02AB00F76507 /* msg_tabbar_sel@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "msg_tabbar_sel@3x.png"; sourceTree = ""; }; 79 | /* End PBXFileReference section */ 80 | 81 | /* Begin PBXFrameworksBuildPhase section */ 82 | 4B2397C81C81953100F155F3 /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | 4B2397C21C81953100F155F3 = { 93 | isa = PBXGroup; 94 | children = ( 95 | 4BA7E6C31CEC02A600F76507 /* Class */, 96 | 4BA7E6BC1CEC027C00F76507 /* XHTabBar */, 97 | 4BA7E6D01CEC02AB00F76507 /* Image */, 98 | 4B2397CD1C81953100F155F3 /* XHTabBarExample */, 99 | 4B2397CC1C81953100F155F3 /* Products */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | 4B2397CC1C81953100F155F3 /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 4B2397CB1C81953100F155F3 /* XHTabBarExample.app */, 107 | ); 108 | name = Products; 109 | sourceTree = ""; 110 | }; 111 | 4B2397CD1C81953100F155F3 /* XHTabBarExample */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 4B2397D11C81953100F155F3 /* AppDelegate.h */, 115 | 4B2397D21C81953100F155F3 /* AppDelegate.m */, 116 | 4B2397D41C81953100F155F3 /* Assets.xcassets */, 117 | 4B2397D61C81953100F155F3 /* LaunchScreen.storyboard */, 118 | 4B2397D91C81953100F155F3 /* Info.plist */, 119 | 4B2397CE1C81953100F155F3 /* Supporting Files */, 120 | ); 121 | path = XHTabBarExample; 122 | sourceTree = ""; 123 | }; 124 | 4B2397CE1C81953100F155F3 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 4B2397CF1C81953100F155F3 /* main.m */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 4BA7E6BC1CEC027C00F76507 /* XHTabBar */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 4BA7E6BD1CEC027C00F76507 /* XHTabBar.h */, 136 | 4BA7E6BE1CEC027C00F76507 /* XHTabBar.m */, 137 | ); 138 | path = XHTabBar; 139 | sourceTree = ""; 140 | }; 141 | 4BA7E6C31CEC02A600F76507 /* Class */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 4BA7E6C41CEC02A600F76507 /* FriendVC.h */, 145 | 4BA7E6C51CEC02A600F76507 /* FriendVC.m */, 146 | 4BA7E6C61CEC02A600F76507 /* MainVC.h */, 147 | 4BA7E6C71CEC02A600F76507 /* MainVC.m */, 148 | 4BA7E6C81CEC02A600F76507 /* MeVC.h */, 149 | 4BA7E6C91CEC02A600F76507 /* MeVC.m */, 150 | 4BA7E6CA1CEC02A600F76507 /* MsgVC.h */, 151 | 4BA7E6CB1CEC02A600F76507 /* MsgVC.m */, 152 | ); 153 | path = Class; 154 | sourceTree = ""; 155 | }; 156 | 4BA7E6D01CEC02AB00F76507 /* Image */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 4BA7E6D11CEC02AB00F76507 /* find_tabbar@2x.png */, 160 | 4BA7E6D21CEC02AB00F76507 /* find_tabbar@3x.png */, 161 | 4BA7E6D31CEC02AB00F76507 /* find_tabbar_sel@2x.png */, 162 | 4BA7E6D41CEC02AB00F76507 /* find_tabbar_sel@3x.png */, 163 | 4BA7E6D51CEC02AB00F76507 /* friend_tabbar@2x.png */, 164 | 4BA7E6D61CEC02AB00F76507 /* friend_tabbar@3x.png */, 165 | 4BA7E6D71CEC02AB00F76507 /* friend_tabbar_sel@2x.png */, 166 | 4BA7E6D81CEC02AB00F76507 /* friend_tabbar_sel@3x.png */, 167 | 4BA7E6D91CEC02AB00F76507 /* home_tabbar@2x.png */, 168 | 4BA7E6DA1CEC02AB00F76507 /* home_tabbar@3x.png */, 169 | 4BA7E6DB1CEC02AB00F76507 /* home_tabbar_sel@2x.png */, 170 | 4BA7E6DC1CEC02AB00F76507 /* home_tabbar_sel@3x.png */, 171 | 4BA7E6DD1CEC02AB00F76507 /* me_tabbar@2x.png */, 172 | 4BA7E6DE1CEC02AB00F76507 /* me_tabbar@3x.png */, 173 | 4BA7E6DF1CEC02AB00F76507 /* me_tabbar_sel@2x.png */, 174 | 4BA7E6E01CEC02AB00F76507 /* me_tabbar_sel@3x.png */, 175 | 4BA7E6E11CEC02AB00F76507 /* msg_tabbar@2x.png */, 176 | 4BA7E6E21CEC02AB00F76507 /* msg_tabbar@3x.png */, 177 | 4BA7E6E31CEC02AB00F76507 /* msg_tabbar_sel@2x.png */, 178 | 4BA7E6E41CEC02AB00F76507 /* msg_tabbar_sel@3x.png */, 179 | ); 180 | path = Image; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXNativeTarget section */ 186 | 4B2397CA1C81953100F155F3 /* XHTabBarExample */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = 4B2397DC1C81953100F155F3 /* Build configuration list for PBXNativeTarget "XHTabBarExample" */; 189 | buildPhases = ( 190 | 4B2397C71C81953100F155F3 /* Sources */, 191 | 4B2397C81C81953100F155F3 /* Frameworks */, 192 | 4B2397C91C81953100F155F3 /* Resources */, 193 | ); 194 | buildRules = ( 195 | ); 196 | dependencies = ( 197 | ); 198 | name = XHTabBarExample; 199 | productName = XHTabBarExample; 200 | productReference = 4B2397CB1C81953100F155F3 /* XHTabBarExample.app */; 201 | productType = "com.apple.product-type.application"; 202 | }; 203 | /* End PBXNativeTarget section */ 204 | 205 | /* Begin PBXProject section */ 206 | 4B2397C31C81953100F155F3 /* Project object */ = { 207 | isa = PBXProject; 208 | attributes = { 209 | LastUpgradeCheck = 0720; 210 | ORGANIZATIONNAME = qiantou; 211 | TargetAttributes = { 212 | 4B2397CA1C81953100F155F3 = { 213 | CreatedOnToolsVersion = 7.2.1; 214 | DevelopmentTeam = 6UD925M2H4; 215 | }; 216 | }; 217 | }; 218 | buildConfigurationList = 4B2397C61C81953100F155F3 /* Build configuration list for PBXProject "XHTabBarExample" */; 219 | compatibilityVersion = "Xcode 3.2"; 220 | developmentRegion = English; 221 | hasScannedForEncodings = 0; 222 | knownRegions = ( 223 | en, 224 | Base, 225 | ); 226 | mainGroup = 4B2397C21C81953100F155F3; 227 | productRefGroup = 4B2397CC1C81953100F155F3 /* Products */; 228 | projectDirPath = ""; 229 | projectRoot = ""; 230 | targets = ( 231 | 4B2397CA1C81953100F155F3 /* XHTabBarExample */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | 4B2397C91C81953100F155F3 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | 4BA7E6F61CEC02AB00F76507 /* msg_tabbar@3x.png in Resources */, 242 | 4BA7E6ED1CEC02AB00F76507 /* home_tabbar@2x.png in Resources */, 243 | 4BA7E6F11CEC02AB00F76507 /* me_tabbar@2x.png in Resources */, 244 | 4BA7E6EE1CEC02AB00F76507 /* home_tabbar@3x.png in Resources */, 245 | 4BA7E6F51CEC02AB00F76507 /* msg_tabbar@2x.png in Resources */, 246 | 4BA7E6F01CEC02AB00F76507 /* home_tabbar_sel@3x.png in Resources */, 247 | 4BA7E6F21CEC02AB00F76507 /* me_tabbar@3x.png in Resources */, 248 | 4BA7E6EC1CEC02AB00F76507 /* friend_tabbar_sel@3x.png in Resources */, 249 | 4BA7E6F41CEC02AB00F76507 /* me_tabbar_sel@3x.png in Resources */, 250 | 4BA7E6F31CEC02AB00F76507 /* me_tabbar_sel@2x.png in Resources */, 251 | 4BA7E6E61CEC02AB00F76507 /* find_tabbar@3x.png in Resources */, 252 | 4B2397D51C81953100F155F3 /* Assets.xcassets in Resources */, 253 | 4BA7E6EA1CEC02AB00F76507 /* friend_tabbar@3x.png in Resources */, 254 | 4B2397D81C81953100F155F3 /* LaunchScreen.storyboard in Resources */, 255 | 4BA7E6E81CEC02AB00F76507 /* find_tabbar_sel@3x.png in Resources */, 256 | 4BA7E6E91CEC02AB00F76507 /* friend_tabbar@2x.png in Resources */, 257 | 4BA7E6F71CEC02AB00F76507 /* msg_tabbar_sel@2x.png in Resources */, 258 | 4BA7E6F81CEC02AB00F76507 /* msg_tabbar_sel@3x.png in Resources */, 259 | 4BA7E6E51CEC02AB00F76507 /* find_tabbar@2x.png in Resources */, 260 | 4BA7E6E71CEC02AB00F76507 /* find_tabbar_sel@2x.png in Resources */, 261 | 4BA7E6EB1CEC02AB00F76507 /* friend_tabbar_sel@2x.png in Resources */, 262 | 4BA7E6EF1CEC02AB00F76507 /* home_tabbar_sel@2x.png in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXResourcesBuildPhase section */ 267 | 268 | /* Begin PBXSourcesBuildPhase section */ 269 | 4B2397C71C81953100F155F3 /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 4BA7E6C11CEC027C00F76507 /* XHTabBar.m in Sources */, 274 | 4BA7E6CD1CEC02A600F76507 /* MainVC.m in Sources */, 275 | 4BA7E6CF1CEC02A600F76507 /* MsgVC.m in Sources */, 276 | 4BA7E6CC1CEC02A600F76507 /* FriendVC.m in Sources */, 277 | 4BA7E6CE1CEC02A600F76507 /* MeVC.m in Sources */, 278 | 4B2397D31C81953100F155F3 /* AppDelegate.m in Sources */, 279 | 4B2397D01C81953100F155F3 /* main.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXSourcesBuildPhase section */ 284 | 285 | /* Begin PBXVariantGroup section */ 286 | 4B2397D61C81953100F155F3 /* LaunchScreen.storyboard */ = { 287 | isa = PBXVariantGroup; 288 | children = ( 289 | 4B2397D71C81953100F155F3 /* Base */, 290 | ); 291 | name = LaunchScreen.storyboard; 292 | sourceTree = ""; 293 | }; 294 | /* End PBXVariantGroup section */ 295 | 296 | /* Begin XCBuildConfiguration section */ 297 | 4B2397DA1C81953100F155F3 /* Debug */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ALWAYS_SEARCH_USER_PATHS = NO; 301 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 302 | CLANG_CXX_LIBRARY = "libc++"; 303 | CLANG_ENABLE_MODULES = YES; 304 | CLANG_ENABLE_OBJC_ARC = YES; 305 | CLANG_WARN_BOOL_CONVERSION = YES; 306 | CLANG_WARN_CONSTANT_CONVERSION = YES; 307 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 308 | CLANG_WARN_EMPTY_BODY = YES; 309 | CLANG_WARN_ENUM_CONVERSION = YES; 310 | CLANG_WARN_INT_CONVERSION = YES; 311 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 312 | CLANG_WARN_UNREACHABLE_CODE = YES; 313 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 314 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 315 | COPY_PHASE_STRIP = NO; 316 | DEBUG_INFORMATION_FORMAT = dwarf; 317 | ENABLE_STRICT_OBJC_MSGSEND = YES; 318 | ENABLE_TESTABILITY = YES; 319 | GCC_C_LANGUAGE_STANDARD = gnu99; 320 | GCC_DYNAMIC_NO_PIC = NO; 321 | GCC_NO_COMMON_BLOCKS = YES; 322 | GCC_OPTIMIZATION_LEVEL = 0; 323 | GCC_PREPROCESSOR_DEFINITIONS = ( 324 | "DEBUG=1", 325 | "$(inherited)", 326 | ); 327 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 328 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 329 | GCC_WARN_UNDECLARED_SELECTOR = YES; 330 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 331 | GCC_WARN_UNUSED_FUNCTION = YES; 332 | GCC_WARN_UNUSED_VARIABLE = YES; 333 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 334 | MTL_ENABLE_DEBUG_INFO = YES; 335 | ONLY_ACTIVE_ARCH = YES; 336 | SDKROOT = iphoneos; 337 | }; 338 | name = Debug; 339 | }; 340 | 4B2397DB1C81953100F155F3 /* Release */ = { 341 | isa = XCBuildConfiguration; 342 | buildSettings = { 343 | ALWAYS_SEARCH_USER_PATHS = NO; 344 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 345 | CLANG_CXX_LIBRARY = "libc++"; 346 | CLANG_ENABLE_MODULES = YES; 347 | CLANG_ENABLE_OBJC_ARC = YES; 348 | CLANG_WARN_BOOL_CONVERSION = YES; 349 | CLANG_WARN_CONSTANT_CONVERSION = YES; 350 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 351 | CLANG_WARN_EMPTY_BODY = YES; 352 | CLANG_WARN_ENUM_CONVERSION = YES; 353 | CLANG_WARN_INT_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_UNREACHABLE_CODE = YES; 356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 358 | COPY_PHASE_STRIP = NO; 359 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 360 | ENABLE_NS_ASSERTIONS = NO; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 366 | GCC_WARN_UNDECLARED_SELECTOR = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 368 | GCC_WARN_UNUSED_FUNCTION = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 371 | MTL_ENABLE_DEBUG_INFO = NO; 372 | SDKROOT = iphoneos; 373 | VALIDATE_PRODUCT = YES; 374 | }; 375 | name = Release; 376 | }; 377 | 4B2397DD1C81953100F155F3 /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 381 | DEVELOPMENT_TEAM = 6UD925M2H4; 382 | INFOPLIST_FILE = XHTabBarExample/Info.plist; 383 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 384 | PRODUCT_BUNDLE_IDENTIFIER = qiantou.XHTabBarExample; 385 | PRODUCT_NAME = "$(TARGET_NAME)"; 386 | }; 387 | name = Debug; 388 | }; 389 | 4B2397DE1C81953100F155F3 /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | DEVELOPMENT_TEAM = 6UD925M2H4; 394 | INFOPLIST_FILE = XHTabBarExample/Info.plist; 395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 396 | PRODUCT_BUNDLE_IDENTIFIER = qiantou.XHTabBarExample; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | }; 399 | name = Release; 400 | }; 401 | /* End XCBuildConfiguration section */ 402 | 403 | /* Begin XCConfigurationList section */ 404 | 4B2397C61C81953100F155F3 /* Build configuration list for PBXProject "XHTabBarExample" */ = { 405 | isa = XCConfigurationList; 406 | buildConfigurations = ( 407 | 4B2397DA1C81953100F155F3 /* Debug */, 408 | 4B2397DB1C81953100F155F3 /* Release */, 409 | ); 410 | defaultConfigurationIsVisible = 0; 411 | defaultConfigurationName = Release; 412 | }; 413 | 4B2397DC1C81953100F155F3 /* Build configuration list for PBXNativeTarget "XHTabBarExample" */ = { 414 | isa = XCConfigurationList; 415 | buildConfigurations = ( 416 | 4B2397DD1C81953100F155F3 /* Debug */, 417 | 4B2397DE1C81953100F155F3 /* Release */, 418 | ); 419 | defaultConfigurationIsVisible = 0; 420 | defaultConfigurationName = Release; 421 | }; 422 | /* End XCConfigurationList section */ 423 | }; 424 | rootObject = 4B2397C31C81953100F155F3 /* Project object */; 425 | } 426 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/project.xcworkspace/xcuserdata/xiaohui.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/XHTabBarExample.xcodeproj/project.xcworkspace/xcuserdata/xiaohui.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/project.xcworkspace/xcuserdata/zhuxiaohui.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/XHTabBarExample.xcodeproj/project.xcworkspace/xcuserdata/zhuxiaohui.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/xcuserdata/xiaohui.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/xcuserdata/xiaohui.xcuserdatad/xcschemes/XHTabBarExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/xcuserdata/xiaohui.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | XHTabBarExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4B2397CA1C81953100F155F3 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/xcuserdata/zhuxiaohui.xcuserdatad/xcschemes/XHTabBarExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /XHTabBarExample.xcodeproj/xcuserdata/zhuxiaohui.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | XHTabBarExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4B2397CA1C81953100F155F3 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /XHTabBarExample/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/XHTabBarExample/.DS_Store -------------------------------------------------------------------------------- /XHTabBarExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XHTabBarExample 4 | // 5 | // Created by xiaohui on 15-4-8. 6 | // Copyright © 2015年 qiantou. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /XHTabBarExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XHTabBarExample 4 | // 5 | // Created by xiaohui on 15-4-8. 6 | // Copyright © 2015年 qiantou. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "XHTabBar.h" 11 | 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | // Override point for customization after application launch. 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | 25 | //控制器数组 26 | NSArray *controllerArray = @[@"MainVC",@"MsgVC",@"FriendVC",@"MeVC"]; 27 | //title数组 28 | NSArray * titleArray = @[@"首页",@"消息",@"朋友",@"我的"]; 29 | //默认图片数组 30 | NSArray *imageArray= @[@"home_tabbar",@"msg_tabbar",@"friend_tabbar",@"me_tabbar"]; 31 | //选中图片数组 32 | NSArray *selImageArray = @[@"home_tabbar_sel",@"msg_tabbar_sel",@"friend_tabbar_sel",@"me_tabbar_sel"]; 33 | //tabBar高度 34 | CGFloat tabBarHeight = 49.0; 35 | 36 | //初始化(height:传nil或<49.0均按49.0处理) 37 | XHTabBar *tabbar = [[XHTabBar alloc] initWithControllerArray:controllerArray titleArray:titleArray imageArray:imageArray selImageArray:selImageArray height:tabBarHeight]; 38 | 39 | //设置为根控制器 40 | self.window.rootViewController = tabbar; 41 | 42 | //设置数字角标(可选) 43 | [tabbar showBadgeMark:100 index:1]; 44 | //设置小红点(可选) 45 | [tabbar showPointMarkIndex:2]; 46 | //不显示角标(可选) 47 | //[tabbar hideMarkIndex:3]; 48 | 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (void)applicationWillResignActive:(UIApplication *)application { 54 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 55 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 56 | } 57 | 58 | - (void)applicationDidEnterBackground:(UIApplication *)application { 59 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 60 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 61 | } 62 | 63 | - (void)applicationWillEnterForeground:(UIApplication *)application { 64 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 65 | } 66 | 67 | - (void)applicationDidBecomeActive:(UIApplication *)application { 68 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 69 | } 70 | 71 | - (void)applicationWillTerminate:(UIApplication *)application { 72 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /XHTabBarExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /XHTabBarExample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /XHTabBarExample/Image/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderZhuXH/XHTabBar/5b9c290cf0f182db2df61b6f48a560bf494e37ff/XHTabBarExample/Image/.DS_Store -------------------------------------------------------------------------------- /XHTabBarExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /XHTabBarExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XHTabBarExample 4 | // 5 | // Created by xiaohui on 16/2/27. 6 | // Copyright © 2016年 qiantou. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | --------------------------------------------------------------------------------