// // KBBaseViewController.m // YouHuiProject // // Created by 小花 on 2018/1/16. // Copyright © 2018年 kuxuan. All rights reserved. // #import "KBBaseViewController.h" @interface KBBaseViewController () @end @implementation KBBaseViewController - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.view bringSubviewToFront:self.navigationBar]; self.navigationController.navigationBar.hidden = YES; } - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor YHColorWithHex:0xf5f4f4]; if ([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)]) { self.automaticallyAdjustsScrollViewInsets = NO; } [self initUI]; } - (void)initUI { self.navigationBar = [[KBNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavBarHeight)]; [self.view addSubview:self.navigationBar]; } - (void)showLoadingView { ActivityIndicatorView *activityView = [[ActivityIndicatorView alloc] initWithTintColor:@[[UIColor redColor],[UIColor yellowColor],[UIColor blueColor]] size:50]; activityView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) ; activityView.backgroundColor = [UIColor whiteColor]; [self.view addSubview:activityView]; [activityView startAnimating]; activityView.tag = 11001; } - (void)dismissLoadingView { ActivityIndicatorView *activityView = (ActivityIndicatorView *)[self.view viewWithTag:11001]; [activityView stopAnimating]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end