iOS6 方向旋转代码

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 此方法iOS6已经不支持。

#if 0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations.
    return YES;
}
#endif
#if 1
- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{

    return UIInterfaceOrientationMaskAllButUpsideDown;
}
#endif

猜你喜欢

转载自lizhuang.iteye.com/blog/1684497