TCNavigationController.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // TCViewController.m
  3. // TCLVBIMDemo
  4. //
  5. // Created by annidyfeng on 16/7/29.
  6. // Copyright © 2016年 tencent. All rights reserved.
  7. //
  8. #import "TCNavigationController.h"
  9. //#import "UIImage+Additions.h"
  10. #import "CYUINavigationBar.h"
  11. @interface TCNavigationController ()
  12. @end
  13. @implementation TCNavigationController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. }
  18. - (void)didReceiveMemoryWarning {
  19. [super didReceiveMemoryWarning];
  20. // Dispose of any resources that can be recreated.
  21. }
  22. /*
  23. #pragma mark - Navigation
  24. // In a storyboard-based application, you will often want to do a little preparation before navigation
  25. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  26. // Get the new view controller using [segue destinationViewController].
  27. // Pass the selected object to the new view controller.
  28. }
  29. */
  30. + (void)initialize
  31. {
  32. if (self == [TCNavigationController class]) {
  33. CYUINavigationBar *bar = [CYUINavigationBar appearance];
  34. [bar setBackgroundColor:UIColorFromRGB(0xe5e5e5)];
  35. [bar setTintColor:[UIColor blackColor]];
  36. [bar setBarTintColor: UIColorFromRGB(0xe5e5e5)];
  37. [bar setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x000000)}];
  38. }
  39. }
  40. - (BOOL)shouldAutorotate
  41. {
  42. return [self.topViewController shouldAutorotate];
  43. }
  44. - (UIInterfaceOrientationMask)supportedInterfaceOrientations
  45. {
  46. return [self.topViewController supportedInterfaceOrientations];
  47. }
  48. - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
  49. {
  50. return [self.topViewController preferredInterfaceOrientationForPresentation];
  51. }
  52. //ios5.0 横竖屏
  53. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
  54. {
  55. return [self shouldAutorotate];
  56. }
  57. @end