Re: Tab bar controller inside a navigation controller, how to adjust the view height
Re: Tab bar controller inside a navigation controller, how to adjust the view height
- Subject: Re: Tab bar controller inside a navigation controller, how to adjust the view height
- From: Matt Neuburg <email@hidden>
- Date: Mon, 31 Jan 2011 12:40:43 -0800
On Mon, 31 Jan 2011 20:29:47 +0800, ico <email@hidden> said:
>I am trying to implement an app similar as "tweetie" applicatin, use
>UIViewController to implement a custom TabBarController that can be pushed
>in a navigation stack. This has been discussed before as shown here:
>
>http://stackoverflow.com/questions/576764/tab-bar-controller-inside-a-navigation-controller-or-sharing-a-navigation-root-v
>
>
>My app running well except for 1 problem. That is if the app receive the
>memory warning message, and one of the view in the tabbar, say this tabbar
>has 3 tabs, the first one's view(a table view) is released as it is not
>active when the app receive the memory warning message, then when user tap
>the first tab to come back with the first view, viewLoad and viewDidLoad
>method is called, but the view's height is not correct. I figure out the
>reason, that is when the tabbar get pushed into the navigation stack, the
>view will automatically subtract the navigationbar height from the view
>height, so that the tableview's height is correct. However, if the view is
>released and come back to it, the tableview's height is not correct anymore
>because it does not adjust the height by minus the navigationbar's height.
>Even though I know the reason, but I can't find a solution to fix it. Any
>help will be appreciated.
You're not supposed to put a tab bar interface inside a navigation interface. A solution that works, and that will avoid the problem you're having, is to present the tab bar interface modally.
If you're not willing to do that, then you might try to implement didReceiveMemoryWarning and just return - thus preventing the view from being unloaded.
m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden