I ran into the same problem described in this OpenRadar issue. As stated there:
Summary: The hidesBottomBarWhenPushed property of UIViewController doesn't work as expected for apps built with iOS 6 SDK (not beta SDKs for iOS 7). The animation is weird when hiding the bottom bar (e.g. a tab bar).
Steps to Reproduce:
Create a new project with the TabBar template in Xcode 4. Add a UINavigationController to the FirstViewController. Add a button on the FirstViewController and set its action to push a new view controller. (please see the sample code attached)
Run the demo on an iOS 7 beta 5 device.
Press the button, back from the UINavigationController, pay attention to the animated view transitions.
Expected Results: The animation works exactly the same as on an iOS 6 device.
Actual Results: The animation looks weird. The FirstViewController is sliding down from the bottom.
Sample code: http://cl.ly/QgZZ
Is there any way to fix or work around this when building with the iOS 6 SDK?
This issue definitely exists. I did some investigation and found out what's causing it. When pushing a view controller with
UINavigationController
, you view controller's view is contained in aUIViewControllerWrapperView
, which a private Apple's view managed by theUINavigationController
. When the transition animation is about to occur and thehidesBottomBarWhenPushed
is set to YES, thisUIViewControllerWrapperView
is being animated with wrongposition
for the Y axis, so the solution is just to overwrite this behaviour and give correct values for the animation. Here's the code:In My Case, I had
TabBarViewController
withUINavigationController
in each tabs & faced similar issue. I used,It works fine when nextScreen is UITableViewController subclass & applied auto layout. But, It does not work fine when
nextScreen
isUIViewController
. I found it depends onnextScreen
auto layout constraints.So I just updated my currentScreen with this code -
In this way you can achieve desired outcome but its not good way to achieve it.
Hope it helps.