dkahgld

ZBBaseViewController.m 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // ZBBaseViewController.m
  3. // ZBProject
  4. //
  5. // Created by 学丽 on 2019/3/26.
  6. // Copyright © 2019 ZB. All rights reserved.
  7. //
  8. #import "ZBBaseViewController.h"
  9. @interface ZBBaseViewController ()
  10. @end
  11. @implementation ZBBaseViewController
  12. - (void)viewWillAppear:(BOOL)animated {
  13. [super viewWillAppear:animated];
  14. [self.view bringSubviewToFront:self.navBar];
  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.navBar = [[ZBNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavBarHeight)];
  27. [self.navBar setNavTitle:self.navigationItem.title];
  28. [self.navBar setYHNavigationBarStyle:YHNavigationBarStyleNormal];
  29. self.navBar.backgroundColor = [UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9600] toColor:[UIColor YHColorWithHex:0xFF7200] withWidth:SCREEN_WIDTH];
  30. [self.view addSubview:self.navBar];
  31. self.backView =[[UIView alloc]initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, 95)];
  32. self.backView.backgroundColor=[UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9600] toColor:[UIColor YHColorWithHex:0xFF7200] withWidth:SCREEN_WIDTH];
  33. self.backView.hidden=YES;
  34. [self.view addSubview:self.backView];
  35. UIButton * headImgBtn =[[UIButton alloc] initWithFrame:CGRectMake(-5, KStatusBarHeight+2, 20, 20)];
  36. [headImgBtn setImage:[UIImage imageNamed:@"menu_icon"] forState:UIControlStateNormal];
  37. headImgBtn.backgroundColor=[UIColor clearColor];
  38. [headImgBtn addTarget: self action:@selector(clickSlideVC) forControlEvents:UIControlEventTouchUpInside];
  39. headImgBtn.selected = YES;
  40. [self.navBar setCustomLeftButtons:@[headImgBtn]];
  41. }
  42. #pragma mark -- 左边控制器页面push方法
  43. -(void)leftSliderClickWithRow{
  44. ZBSetViewController *setv=[[ZBSetViewController alloc]init];
  45. [self.navigationController pushViewController:setv animated:YES];
  46. }
  47. -(void)clickSlideVC
  48. {
  49. [[self sliderViewController] showLeftWithType:self.typePush];
  50. }
  51. - (void)showLoadingView {
  52. // ActivityIndicatorView *activityView = [[ActivityIndicatorView alloc] initWithTintColor:@[[UIColor redColor],[UIColor yellowColor],[UIColor blueColor]] size:50];
  53. // activityView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) ;
  54. // activityView.backgroundColor = [UIColor whiteColor];
  55. // [self.view addSubview:activityView];
  56. // [activityView startAnimating];
  57. // activityView.tag = 11001;
  58. }
  59. - (void)dismissLoadingView {
  60. // ActivityIndicatorView *activityView = (ActivityIndicatorView *)[self.view viewWithTag:11001];
  61. // [activityView stopAnimating];
  62. }
  63. - (void)didReceiveMemoryWarning {
  64. [super didReceiveMemoryWarning];
  65. // Dispose of any resources that can be recreated.
  66. }
  67. @end