口袋优选

KBBaseViewController.m 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // KBBaseViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "KBBaseViewController.h"
  9. @interface KBBaseViewController ()
  10. @end
  11. @implementation KBBaseViewController
  12. - (void)viewWillAppear:(BOOL)animated {
  13. [super viewWillAppear:animated];
  14. [self.view bringSubviewToFront:self.navigationBar];
  15. self.navigationController.navigationBar.hidden = YES;
  16. }
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.view.backgroundColor = [UIColor YHColorWithHex:0xf5f4f4];
  20. if ([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)]) {
  21. self.automaticallyAdjustsScrollViewInsets = NO;
  22. }
  23. [self initUI];
  24. }
  25. - (void)initUI {
  26. self.navigationBar = [[KBNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavBarHeight)];
  27. [self.view addSubview:self.navigationBar];
  28. }
  29. - (void)showLoadingView {
  30. ActivityIndicatorView *activityView = [[ActivityIndicatorView alloc] initWithTintColor:@[[UIColor redColor],[UIColor yellowColor],[UIColor blueColor]] size:50];
  31. activityView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) ;
  32. activityView.backgroundColor = [UIColor whiteColor];
  33. [self.view addSubview:activityView];
  34. [activityView startAnimating];
  35. activityView.tag = 11001;
  36. }
  37. - (void)dismissLoadingView {
  38. ActivityIndicatorView *activityView = (ActivityIndicatorView *)[self.view viewWithTag:11001];
  39. [activityView stopAnimating];
  40. }
  41. - (void)didReceiveMemoryWarning {
  42. [super didReceiveMemoryWarning];
  43. // Dispose of any resources that can be recreated.
  44. }
  45. /*
  46. #pragma mark - Navigation
  47. // In a storyboard-based application, you will often want to do a little preparation before navigation
  48. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  49. // Get the new view controller using [segue destinationViewController].
  50. // Pass the selected object to the new view controller.
  51. }
  52. */
  53. @end