一、.h
@interface myTabBarController : UIViewController
@property(nonatomic,strong)UIImageView *tabBarBgImageView;//设置tabBar的背景颜色
@property(nonatomic,strong)UIColor *titleColorNormal;
@property(nonatomic,strong)UIColor *titleColorSelected;
@property(nonatomic,assign)UIEdgeInsets barTitleEdge;
@property(nonatomic,assign)UIEdgeInsets barImageEdge;
-(void)setTabBarControllerWithVCArray:(NSArray *)vcArray andPhotoArray:(NSArray *)photoArray selectedPhotoArray:(NSArray *)selectedPhotoArray titleArray:(NSArray *)titleArray;
@end
二、.m
#import "myTabBarController.h"
@interface myTabBarController ()
@property(nonatomic,strong)UIViewController *currentViewController;
@property(nonatomic,strong)UIButton *currentSelectedButton;
@property(nonatomic,strong)NSArray *vcArray;
@property(nonatomic,strong)NSArray *photoArray;
@property(nonatomic,strong)NSArray *titleArray;
@property(nonatomic,strong)NSArray *selectedPhotoArray;
@end
@implementation myTabBarController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.