UINavigationController+Theme.m 1.14 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
/*****************************************************************************
 * UINavigationController+Theme.m
 * VLC for iOS
 *****************************************************************************
 * Copyright (c) 2013 VideoLAN. All rights reserved.
 * $Id$
 *
 * Authors: Felix Paul Kühne <fkuehne # videolan.org>
 *          Romain Goyet <romain.goyet # applidium.com>
 *
 * Refer to the COPYING file of the official project for license.
 *****************************************************************************/
13
14
15
16
17
18
19

#import "UINavigationController+Theme.h"

@implementation UINavigationController (Theme)
- (void)loadTheme
{
    UINavigationBar *navBar = self.navigationBar;
Felix Paul Kühne's avatar
Felix Paul Kühne committed
20
    if (!SYSTEM_RUNS_IOS7_OR_LATER) {
21
        [navBar setBackgroundImage:[UIImage imageNamed:@"navBarBackground"] forBarMetrics:UIBarMetricsDefault];
22
        navBar.barStyle = UIBarStyleBlack;
Felix Paul Kühne's avatar
Felix Paul Kühne committed
23
        navBar.translucent = NO;
24
        navBar.opaque = YES;
25
    } else {
26
        navBar.barTintColor = [UIColor VLCOrangeTintColor];
27
28
29
        navBar.tintColor = [UIColor whiteColor];
        navBar.titleTextAttributes = @{ UITextAttributeTextColor : [UIColor whiteColor] };
    }
30
31
}
@end