Skip to content

Instantly share code, notes, and snippets.

@darkseed
Created August 19, 2011 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save darkseed/1157542 to your computer and use it in GitHub Desktop.
Save darkseed/1157542 to your computer and use it in GitHub Desktop.
UITabBarController+CCAdditions.h
#import "UITabBarController+CCAdditions.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[tabBarController setBackgroundImage:[UIImage imageNamed:@"CustomTabBarBackground.png"]];
[tabBarController.view setNeedsDisplay];
return YES;
}
@interface UITabBarController (CCAdditions)
- (void) setBackgroundImage:(UIImage *)image;
@end
#import "UITabBarController+CCAdditions.h"
@implementation UITabBarController (CCAdditions)
- (void) setBackgroundImage:(UIImage *)image
{
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)];
imageView.backgroundColor = [UIColor colorWithPatternImage:i];
[[self view] addSubview:imageView];
[[self view] sendSubviewToBack:imageView];
[[self view] setOpaque:NO];
[[self view] setBackgroundColor:[UIColor clearColor]];
[imageView release];
}
@end
@jameswomack
Copy link

Nice, this is from my CCAdditions repo on GitHub

@darkseed
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment