XCODE shouldAutorotateToInterfaceOrientation 对于不同版本 设备旋转不同方向时 视图的相应旋转方向的实现

对于版本号不同的设备,旋转时视图的要做出相应的旋转,那么版本不同,代码的实现是如何的,如何对旋转方向做出限制下面是小编的个人看法!

//版本号为3.5 -5.0

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

{

  //   return NO; //不支持随设备多的旋转而旋转;

    return(toInterfaceAorientation != UIInterfaceOrientationLandscapeLeft);//当power键端旋转方向向左是视图不旋转

}

//版本号为6.0以上时

-(BOOL)shouldAutorotate

{

return YES;

}

- (NSUInteger)supportedInterfaceOrientations

{

    return UIInterfaceOrientationMaskAllButUpsideDown;

}

如果有疑问和不同看法的 请加QQ:1649419270 微信号:meixianLYD

posted @ 2015-05-10 11:21  meixianLYD  阅读(388)  评论(0编辑  收藏  举报