简体   繁体   中英

iOS7 NavigationBar visually grows from 44 to 64 points every segue

I'm working on an old code base written using Three20 (ack!). Now we need to be able to deploy this app to iOS7 and iOS6.

Mostly, it's working, but when the user taps and causes switching between view controllers, the navigation bar is drawn with a 44 point navigation bar during the transition animation, but when the animation finishes then it snaps to 64 points tall.

So, switch a view...smooth...butter... slam . Wash, rinse, repeat.

It's such a juddering effect when you switch from one view to another, on any iOS 7 iPhone-sized device. Interestingly, it only happens when switching from one view to another, not when switching to a new instance of the current ViewController.

I'd show code, but I'm not sure what code to show.

I'd appreciate any pointers at all (RTFM comments gladly accepted), my Google-fu has failed me this time.

View hierarchy looks something like this: UIScreen TTNavigatorWindow UILayoutContainerView UINavigationTransitionView UIViewControllerWrapperView UIView TTTableView UITableViewWrapperView ...and so on...

Is this a three20 problem where three20 assumed that Navigation Bars are always 44 points tall, but now they're not?

Is this an Interface Builder issue where the Navigation bars can only be created at 44 points, and I'm supposed to deal with this well in my code?

Is this an esoteric iOS 7 issue where it's decided that because the Navigator is at the top level, that it needs to change the height on a regular basis?

Is this a documentation issue where my (obviously meagre) powers of observation just didn't see the relevant bit in the Apple docs?

Thanks,

-Ken

First of all I would like to recommend to get rid of Three20. I know this is not very helpful for your situation, but really.

But then I would like to offer you two ideas on would could be happening:

  • Three20 indeed uses a hardcoded navigation bar size in various places, but I don't think this causes the problem you describe here. I may although pretty sure it causes Problem with iOS7 at other places.

  • From what you describe it sounds like the way iOS7 calculates the navigation bar height might be the problem. Of cause that would somehow inferrer with how three20 manages view, cause it works ok for plain UIKit. What happens if you move your whole view stack 1 px down, towards the bottom of the screen? I guess, that the navigation bar does not change it's size then. To understand that take a look at how iOS7 calculates the navigation bar height . I guess what you would like to have is the 64 px navigationbar throughout the whole animation. I'll have to figure out how to modify the frame of the view controller being presented before the animation to achieve that effect.

I hope some of this ideas can be helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM