FMBaseViewController.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // BaseViewController.m
  3. // Canada
  4. //
  5. //
  6. #import "FMBaseViewController.h"
  7. @interface FMBaseViewController ()
  8. @end
  9. @implementation FMBaseViewController
  10. @synthesize navigation = _navigation;
  11. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  12. {
  13. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  14. if (self) {
  15. // Custom initialization
  16. }
  17. return self;
  18. }
  19. - (void)viewDidLoad
  20. {
  21. [super viewDidLoad];
  22. self.view.backgroundColor = [UIColor whiteColor];
  23. NSString * systeam = [UIDevice currentDevice].systemVersion;
  24. float number = [systeam floatValue];
  25. CGFloat height = 0.0f;
  26. NSInteger type = 0;
  27. if (number <= 6.9) {
  28. type = 0;
  29. height = 44.0f;
  30. }else{
  31. type = 1;
  32. height = 66.0f;
  33. }
  34. globle = [Globle shareGloble];
  35. self.navigation = [[ZZNavigationView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, height)];
  36. _navigation.type = type;
  37. _navigation.leftImage = [UIImage imageNamed:@"nav_backbtn.png"];
  38. _navigation.delegate = self;
  39. _navigation.backgroundColor = [UIColor whiteColor];
  40. [self.view addSubview:_navigation];
  41. // Do any additional setup after loading the view.
  42. }
  43. #pragma mark ##### ZZNavigationViewDelegate ####
  44. -(void)previousToViewController
  45. {
  46. [self.navigationController popViewControllerAnimated:YES];
  47. }
  48. -(void)rightButtonClickEvent
  49. {
  50. }
  51. - (void)didReceiveMemoryWarning
  52. {
  53. [super didReceiveMemoryWarning];
  54. // Dispose of any resources that can be recreated.
  55. }
  56. @end