绘制SegmentViewController的方法

2015-12-10  本文已影响278人  Roger_单

pragma mark - Methods

UIViewController *firstViewController = [[SupermarketViewController alloc] init];

UIViewController *firstNavigationController = [[UINavigationController alloc]

initWithRootViewController:firstViewController];

//实例化三个ViewController

OrderViewController *firstVC = [[OrderViewController alloc] init];

twoViewController *secondVC =[[twoViewController alloc] init];

threeViewController *thirdVC = [[threeViewController alloc] init];

JRSegmentViewController *vc = [[JRSegmentViewController alloc] init];

//显示三个按钮

[vc setTitles:@[@"全部", @"待收货", @"待评价"]];

//设置segmentBg的颜色

vc.segmentBgColor = [UIColor orangeColor];

vc.indicatorViewColor = [UIColor whiteColor];

[vc setViewControllers:@[firstVC, secondVC, thirdVC]];

UIViewController *secondViewController = vc;

UIViewController *secondNavigationController = [[UINavigationController alloc]

initWithRootViewController:secondViewController];

UIViewController *thirdViewController = [[MineViewController alloc] init];

UIViewController *thirdNavigationController = [[UINavigationController alloc]

initWithRootViewController:thirdViewController];

RDVTabBarController *tabBarController = [[RDVTabBarController alloc] init];

[tabBarController setViewControllers:@[firstNavigationController, secondNavigationController,

thirdNavigationController]];

self.viewController = tabBarController;

[self customizeTabBarForController:tabBarController];

}

之后引入一个第三方JRSegmentViewController

上一篇 下一篇

猜你喜欢

热点阅读