12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- //
- // ZBBaseViewController.m
- // ZBProject
- //
- // Created by 学丽 on 2019/3/26.
- // Copyright © 2019 ZB. All rights reserved.
- //
- #import "ZBBaseViewController.h"
- @interface ZBBaseViewController ()
- @end
- @implementation ZBBaseViewController
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [self.view bringSubviewToFront:self.navBar];
- 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.navBar = [[ZBNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavBarHeight)];
-
- [self.navBar setNavTitle:self.navigationItem.title];
- [self.navBar setYHNavigationBarStyle:YHNavigationBarStyleNormal];
- self.navBar.backgroundColor = [UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9600] toColor:[UIColor YHColorWithHex:0xFF7200] withWidth:SCREEN_WIDTH];
- [self.view addSubview:self.navBar];
- self.backView =[[UIView alloc]initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, 95)];
- self.backView.backgroundColor=[UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9600] toColor:[UIColor YHColorWithHex:0xFF7200] withWidth:SCREEN_WIDTH];
- self.backView.hidden=YES;
- [self.view addSubview:self.backView];
-
-
- UIButton * headImgBtn =[[UIButton alloc] initWithFrame:CGRectMake(-5, KStatusBarHeight+2, 20, 20)];
- [headImgBtn setImage:[UIImage imageNamed:@"menu_icon"] forState:UIControlStateNormal];
- headImgBtn.backgroundColor=[UIColor clearColor];
- [headImgBtn addTarget: self action:@selector(clickSlideVC) forControlEvents:UIControlEventTouchUpInside];
- headImgBtn.selected = YES;
-
- [self.navBar setCustomLeftButtons:@[headImgBtn]];
-
-
-
-
- }
- #pragma mark -- 左边控制器页面push方法
- -(void)leftSliderClickWithRow{
-
- ZBSetViewController *setv=[[ZBSetViewController alloc]init];
- [self.navigationController pushViewController:setv animated:YES];
-
- }
- -(void)clickSlideVC
- {
- [[self sliderViewController] showLeftWithType:self.typePush];
- }
- - (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.
- }
- @end
|