Skip to content

Instantly share code, notes, and snippets.

@ssoper
Created June 14, 2009 16:53
Show Gist options
  • Save ssoper/129748 to your computer and use it in GitHub Desktop.
Save ssoper/129748 to your computer and use it in GitHub Desktop.
Add a tint to your UITabBarController
// Add a tint to your UITabBarController
// This goes in your implementation (.m) file
CGRect frame = CGRectMake(0.0, 0.0, tabBarController.view.bounds.size.width, 48);
UIView *v = [[UIView alloc] initWithFrame:frame];
[v setBackgroundColor: [UIColor colorWithRed: 0.078f green: 0.204f blue: 0.369f alpha: 0.99f]];
[v setAlpha:0.4];
[[tabBarController tabBar] insertSubview: v belowSubview: [[[tabBarController tabBar] subviews] objectAtIndex: 0]];
[v release];
// Don't forget to add a forward reference in your header (.h) file to silence the warnings
@interface UITabBarController (PrivateMethods)
- (UITabBar *) tabBar;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment