Fork me on GitHub

默认横屏

在info.plist中增加一项:

<key>UIInterfaceOrientation</key>

<string>UIInterfaceOrientationLandscapeRight</string>

再加一项 initial interface orientation  Landscape(right)

View- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);

}

 在interface builder中,点选窗口右上角的旋转图标,把窗口视图转成水平的。

 

另:

 

applicationDidFinishLaunching: 方 法 的 一 开 始 执 行UIApplication的setStatusBarOrientation:animated:方法。

posted on 2012-04-11 14:29  pengyingh  阅读(242)  评论(0编辑  收藏  举报

导航