Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>This is dirty - but works and got approved:</strong></p> <ul> <li>resizes tabbar</li> <li>use your own images in own size</li> </ul> <p>in the tab controller setup</p> <pre><code> tabController = [[UITabBarController alloc] init]; tabController.view.frame = CGRectMake(0, 72, 320, 480 - (82)); tabController.delegate = self; UIImageView *bgImageView; bgImageView = [ [ UIImageView alloc ] initWithImage: [UIImage imageNamed:TABBAR_BACKGROUND]]; bgImageView.frame = CGRectMake(0, -11, 320, 60); [[tabController tabBar] addSubview:bgImageView]; [[tabController tabBar] sendSubviewToBack:bgImageView]; tabController.tabBar.frame = CGRectMake(0, 460 - (59 + 52 - 11), 320, 49); [bgImageView release]; [window addSubview:tabController.view]; </code></pre> <p>in the tabviewcontroller1 init method</p> <pre><code> - (id) init { if(self = [super init]) { CustomTabBarItem *tabItem = [[CustomTabBarItem alloc] initWithTitle:@"" image:nil tag:0]; tabItem.customHighlightedImage=[UIImage imageNamed:TABBAR_TAB_1_ACTIVE]; tabItem.customStdImage=[UIImage imageNamed:TABBAR_TAB_1_DEFAULT]; self.tabBarItem=tabItem; [tabItem release]; tabItem=nil; } return self; } </code></pre> <p>and the custom tab bar it looks like</p> <pre><code> @interface CustomTabBarItem : UITabBarItem { UIImage *customHighlightedImage; UIImage *customStdImage; } @property (nonatomic, retain) UIImage *customHighlightedImage; @property (nonatomic, retain) UIImage *customStdImage; @end #import "CustomTabBarItem.h" @implementation CustomTabBarItem @synthesize customHighlightedImage; @synthesize customStdImage; - (void) dealloc { [customHighlightedImage release]; customHighlightedImage=nil; [customStdImage release]; customStdImage=nil; [super dealloc]; } -(UIImage *) selectedImage { return self.customHighlightedImage; } -(UIImage *) unselectedImage { return self.customStdImage; } @end </code></pre> <p><strong>IMPORTANT:</strong></p> <p>i'm pretty new to iphone development and pretty pretty shure you can do this way less hacky. furthermore i got approved with this which does NOT mean you autmoatically will, too.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload