Created
April 22, 2011 00:53
-
-
Save doronkatz/935796 to your computer and use it in GitHub Desktop.
Quick way to modify look of UITabBarController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark UITabBarController customisation to add background image | |
//In your appDelegate, just use categories to add functionality to UITabBarController | |
//overloading viewDidLoad. No need to subclass | |
@implementation UITabBarController (UITabBarControllerCategory) | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
CGRect frame = CGRectMake(0.0, 0.0, self.view.bounds.size.width, 48); | |
UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame]; | |
UIImage *img = [UIImage imageNamed: @"uinavbar.png"]; | |
[imageView setImage:img]; | |
[imageView setAlpha:0.5]; | |
[[self tabBar] addSubview:imageView]; | |
[imageView release]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment