English 中文(简体)
resize uinavigationbar push/pop viewcontroller size issue
原标题:

i need to shrink the height of a UINavigationBar (attached to the UINavigationController)

i ve done this via the UINavigationControllerDelegate s navigationController:didShowViewController method, and it s working fine.

the problem is the visible viewcontroller that s in the main view. it wasn t resizing itself to reflect the new navbar height. thus, the didShowViewController method also resizes the viewcontroller s view frame, which works fine.

however, when i go to push on a new ViewController, or pop, i always see the view shift down to the original position during the animated transition to the next view. then, due to the code i have in the didShowViewController in the NavControllerDelegate, it shifts it back up.

i m curious as to the best way to ensure that the shift down never happens.

i tried placing the code that resizes the frame into the willShowViewController, but that doesn t do anything.

i ve also made sure that the UIView s frame that is the view of the UIViewController that s being popped, is also of the proper/shifted dimensions. no go there.

it s like i need to intercept the drawing actions after the pushViewController is invoked, and before the UINavigationController s didShowViewController is called.

i ve been staring at my code for hours & hours... not getting anywhere. hopefully this makes sense to someone out there.

thanks!!!

最佳回答

Another option I think would be to set the NavigationControllers navigationBarHidden equal to YES. This will hide the nav bar completely and then you can then draw whatever view you want in the place the bar would have resided. Just put controls on the view that wrap the navigation methods (push, pop, etc...). It might be a challenge to get it to have the same style as a nav bar though.

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签