VLCNavigationController.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*****************************************************************************
  2. * VLCNavigationController.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. #import "VLCNavigationController.h"
  13. @interface VLCNavigationController ()
  14. {
  15. BOOL _setup;
  16. }
  17. @end
  18. @implementation VLCNavigationController
  19. - (void)viewWillAppear:(BOOL)animated
  20. {
  21. [super viewWillAppear:animated];
  22. if (_setup)
  23. return;
  24. UINavigationBar *navigationBar = self.navigationBar;
  25. if (!SYSTEM_RUNS_IOS7_OR_LATER) {
  26. [navigationBar setBackgroundImage:[UIImage imageNamed:@"navBarBackground"] forBarMetrics:UIBarMetricsDefault];
  27. navigationBar.barStyle = UIBarStyleBlack;
  28. navigationBar.translucent = NO;
  29. navigationBar.opaque = YES;
  30. } else {
  31. navigationBar.barTintColor = [UIColor VLCOrangeTintColor];
  32. navigationBar.tintColor = [UIColor whiteColor];
  33. navigationBar.titleTextAttributes = @{ UITextAttributeTextColor : [UIColor whiteColor] };
  34. }
  35. _setup = YES;
  36. }
  37. @end