开发者

Iphone View Rotation not functioning properly

I have a simple 1 screen app, with 1 View.. the view contains

a button, an textbox and a button across the top

A segmented controller across the bottom

and a MapView in between.

In portrait mode all is right with the world.. So I decided to begin to allow Orientation change...

in IB all views and elements and even the root window have autoResizeSubviews set

in My AppDelegate and my viewController I have also programatically added SetAutoResizeSubviews to yes explicitely I have set the autoResizingMask in the Root Window and the View Controller to FlexibleWidht | Flexibile Height

I have added the shouldAutorotateToInterfaceOrientation in my ViewController to always return true.

Yet, it doesn't work.. Or should I say it doesn't rotate properly.. in both portrait modes everything looks great, but both landscape modes, things don't get laid out or resized properly.. Basically all I see is the mapview, and its size gets slightly wider, but not much than the portrait mode, and it doesn't fill up the screen top to bottom.. all other interface elements with the exception of one button are invisible and it appears on TOP of the mapview.. as th开发者_开发百科ought it just happened to be layed out over the view by coincidence than any design.

Anyone have any ideas what I am missing, or why?

Thanks in advance


You say "I have set the autoResizingMask in the Root Window and the View Controller" but that is a red herring. It is the buttons, the text box, the segmented controller, and the map view that have to have the correct autoresizingMask. If this view is being designed in the nib, you can set the values there and then turn the orientation right there in the nib and see what happens.

If you are unable to work out good autoresizingMask values for all those interface elements, implement didRotateFromInterfaceOrientation and perform the layout alterations in code when called upon to do so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜