Saturday, 15 September 2012

iphone - Resizing UINavigationBar on rotation -


I have a subclass of UIViewController that handles a UIView. The View Controller is modeled (it slides down from the bottom of the screen) at the top of the view, I have added a navigation bar Note that this time it is not used by any navigation controller.

When I rotate in the scenario, I want to shrink the nebara in height (as handled by the UI navigation controller). However, I can not set my autorissising mask in the flexible height in the IB, and the code disappears completely by doing this.

Is there any way to do this? How is this done by the UIA controller?

P.S. I do not like to resort to a scaling transformation because it will spoil the text in the title.

EDIT: I solved this with a little help, read the answers posted below.

Instead of setting the autocorrection of the mask, why not see the current orientation just by handler , As well as the Thoratiform Interface Orientation, and set the proper framework?

  - (Zero) UpdateNews {UIInterface Orientation Orientation = [[UIApplication shared application] Status BarOrientation]; If ((UIInterfaceOrientationLandscapeLeft == Orientation) || (UIInterfaceOrientationLandscapeRight == orientation)) {myNavBar.frame = CGRectMake (0, 0, 480, 34); } And {myNavBar.frame = CGRectMake (0, 0, 320, 44); }} - (zero) ViewViewPaper {[Self update Nawabbar]; // ... SNIP ...} - (zero) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) InterfaceOrderation {[Self Update NavBar]; // ... SNIP ...}  

No comments:

Post a Comment