Skip to content

Commit

Permalink
remove shadows from navbar.
Browse files Browse the repository at this point in the history
  • Loading branch information
jflinter committed May 17, 2013
1 parent 32410e8 commit a8ae38e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/ios/UINavigationBar+FlatUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

@interface UINavigationBar (FlatUI)

- (void) configureFlatNavigationBarWithColor:(UIColor *)color;
- (void) configureFlatNavigationBarWithColor:(UIColor *)color; UI_APPEARANCE_SELECTOR

@end
8 changes: 8 additions & 0 deletions Classes/ios/UINavigationBar+FlatUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ @implementation UINavigationBar (FlatUI)
- (void) configureFlatNavigationBarWithColor:(UIColor *)color {
[self setBackgroundImage:[UIImage imageWithColor:color cornerRadius:0]
forBarMetrics:UIBarMetricsDefault & UIBarMetricsLandscapePhone];
NSMutableDictionary *titleTextAttributes = [[self titleTextAttributes] mutableCopy];
if (!titleTextAttributes) {
titleTextAttributes = [NSMutableDictionary dictionary];
}
[titleTextAttributes setValue:[UIColor clearColor] forKey:UITextAttributeTextShadowColor];
[titleTextAttributes setValue:[NSValue valueWithUIOffset:UIOffsetMake(0, 0)] forKey:UITextAttributeTextShadowOffset];
[self setTitleTextAttributes:titleTextAttributes];
[self setShadowImage:[UIImage imageWithColor:[UIColor clearColor] cornerRadius:0]];
}

@end
2 changes: 1 addition & 1 deletion Example/FlatUIKitExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ - (void)viewDidLoad
disabledColor:[UIColor amethystColor]
iconColor:[UIColor cloudsColor]];

[self.navigationController.navigationBar configureFlatNavigationBarWithColor:[UIColor midnightBlueColor]];
self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeFont: [UIFont boldFlatFontOfSize:18]};
[self.navigationController.navigationBar configureFlatNavigationBarWithColor:[UIColor midnightBlueColor]];

self.flatSwitch.onColor = [UIColor turquoiseColor];
self.flatSwitch.offColor = [UIColor cloudsColor];
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FlatUIKit can be installed via [Cocoapods](http://cocoapods.org/). Simply add

to your Podfile. If you don't use Cocoapods you're welcome to use git submodules, or simply [download it](https://github.com/Grouper/FlatUIKit/archive/master.zip) and include it in your project manually.

Note that FlatUIKit requires the CoreText framework as well as iOS > 5.0.
Note that FlatUIKit requires the CoreText framework as well as iOS > 6.0.

The Components
-------
Expand Down

0 comments on commit a8ae38e

Please sign in to comment.