酷店

KDPMainViewController.m 967B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // KDPMainViewController.m
  3. // KuDianProject
  4. //
  5. // Created by 学丽 on 2019/7/4.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPMainViewController.h"
  9. @interface KDPMainViewController ()
  10. @end
  11. @implementation KDPMainViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. [self.view addSubview:self.navBar];
  15. }
  16. -(void)viewWillLayoutSubviews
  17. {
  18. self.view.frame=[UIScreen mainScreen].bounds;
  19. }
  20. -(void)viewWillAppear:(BOOL)animated
  21. {
  22. [super viewWillAppear:animated];
  23. self.navigationController.navigationBar.hidden=YES;
  24. [self.view bringSubviewToFront:self.navBar];
  25. }
  26. -(KDPNavBar *)navBar
  27. {
  28. if (!_navBar) {
  29. _navBar=[[KDPNavBar alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, KDNavBarHeight)];
  30. _navBar.backgroundColor=[UIColor gradientOneColor:[UIColor colorWithHexString:@"#FF235F"] toColor:[UIColor colorWithHexString:@"#FF7676"] Width:SCREEN_WIDTH];
  31. }
  32. return _navBar;
  33. }
  34. @end