Created
June 14, 2009 16:53
-
-
Save ssoper/129748 to your computer and use it in GitHub Desktop.
Add a tint to your UITabBarController
This file contains hidden or 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
// 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