猎豆优选

LDBaseViewController.m 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // LDBaseViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LDBaseViewController.h"
  9. #import "ActivityIndicatorView.h"
  10. @interface LDBaseViewController ()
  11. @end
  12. @implementation LDBaseViewController
  13. - (void)viewWillAppear:(BOOL)animated {
  14. [super viewWillAppear:animated];
  15. [self.view bringSubviewToFront:self.navigationBar];
  16. self.navigationController.navigationBar.hidden = YES;
  17. }
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. self.view.backgroundColor = [UIColor YHColorWithHex:0xf5f4f4];
  21. if ([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)]) {
  22. self.automaticallyAdjustsScrollViewInsets = NO;
  23. }
  24. [self initUI];
  25. }
  26. - (void)initUI {
  27. self.navigationBar = [[LDNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavBarHeight)];
  28. [self.view addSubview:self.navigationBar];
  29. }
  30. - (void)showLoadingView {
  31. ActivityIndicatorView *activityView = [[ActivityIndicatorView alloc] initWithTintColor:@[[UIColor redColor],[UIColor yellowColor],[UIColor blueColor]] size:50];
  32. activityView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) ;
  33. activityView.backgroundColor = [UIColor whiteColor];
  34. [self.view addSubview:activityView];
  35. [activityView startAnimating];
  36. activityView.tag = 11001;
  37. }
  38. - (void)dismissLoadingView {
  39. ActivityIndicatorView *activityView = (ActivityIndicatorView *)[self.view viewWithTag:11001];
  40. [activityView stopAnimating];
  41. }
  42. - (void)didReceiveMemoryWarning {
  43. [super didReceiveMemoryWarning];
  44. // Dispose of any resources that can be recreated.
  45. }
  46. @end