Discussion Forums  >  Status Bar, Navigation Bar

Replies: 5    Views: 203

farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
05/13/13 12:50 PM (10 years ago)

My Nav bar on a yo yo diet

Hi guys, I am working on this IOS app (self hosted) which is blocked to landscape. When I first launch the app on the simulator (or device) the height of the nav bar seems normal but it get much thinner after navigating on a few screens. Here is before: https://www.dropbox.com/s/jwleaiecl8u1vkg/screenshot_navbar_fat.png Here is after: https://www.dropbox.com/s/1y7q6q1nzgwfrfb/screenshot_navbar_thin.png It is a pain as some of my content is pixel perfect and I can't have a nav bar putting on and losing weight like that!! Anyone has any idea how to block the height on all screen to the largest nav bar? Cheers, Farcat
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/13/13 01:03 PM (10 years ago)
the second navbar height is the right dimension 32 as opposed to 44, it's designed to give you more space. Does the narrower nav bar appear when the app is refreshed or only when the screen is changed to the next and then back. It is strange
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
05/13/13 01:17 PM (10 years ago)
Thanks @Kittsy. I can do with more space. The change of size is not after refresh, only when I navigate through my bottoms tabs. I have PM'd you with more details about the project, cheers.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/13/13 02:01 PM (10 years ago)
Solution to the problem. This may cause an issue with some plugins that resize depending on the height of the navbar. There is an easy fix, if you search for +44 in the plugins you can amke a similar if ipad else statement to change the value from 44 to 32. Go to BT_viewUtilities.m replace the whole method from line 48 to 59 with this //frame for nav bar +(CGRect)frameForNavBarAtOrientation:(UIViewController *)theViewController theScreenData:(BT_item *)theScreenData{ yourApp_appDelegate *appDelegate = (yourApp_appDelegate *)[[UIApplication sharedApplication] delegate]; CGFloat height; if([appDelegate.rootApp.rootDevice isIPad]){ height = UIInterfaceOrientationIsPortrait(theViewController.interfaceOrientation) ? 44 : 44; }else{ height = UIInterfaceOrientationIsPortrait(theViewController.interfaceOrientation) ? 44 : 32; } //is the status bar hidden? if([UIApplication sharedApplication].statusBarHidden){ return CGRectMake(0, 0, theViewController.view.bounds.size.width, height); }else{ return CGRectMake(0, 20, theViewController.view.bounds.size.width, height); } }
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
05/13/13 02:20 PM (10 years ago)
Thanks @Kittsy, it worked just great!!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/13/13 08:39 PM (10 years ago)
Is this a change that should be made permanent by David? -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.