开发者

Interface Builder to follow full-screen and orientation rules?

I have an app that uses the "Status bar is initially hidden" property in the plist file to create a full-screen presentation. Works fine.

In the viewController, the shouldAutorotateToInterfaceOrientation method returns YES if interfaceOrientation != portrait or portraitUpsideDown, thus, my app works in landscapeLeft and landscapeRight. And it does so fine.

But, when I enter into Xcode 4's interface builder, my viewController and custom views all show the status bar, and are always in Portrait mode.

This makes 开发者_如何学Pythonit difficult to work with custom views that are 1024x768 fullscreen. I can never entirely tell easily if what I am seeing is in fact the full view PLUS the status bar, or if my custom view is showing behind the status bar, etc. And, particularly strange, my custom view retains an x,y coordinate system in Portrait mode, even when my app is in landscape. Usually, x and y switch places when I rotate a view controller, but this doesn't seem to work on a custom view.

So in short, how can I get my views and controller and interface builder to all be landscape-friendly, with no status bar?


In the IB, click on your main view and open the Attributes window (command-1). Under "Simulated User Interface Elements", change "Orientation" to "Landscape" and "Status Bar" to "Unspecified".

Remember, the IB doesn't read all of your code, so it doesn't know what you've done programmatically.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜