当前位置:编程学习 > wap >>

IOS6横屏

只支持portait,不能旋转:


-(BOOL)shouldAutorotate

{

    return NO;

}


支持旋转:

-(BOOL)shouldAutorotate

{

    return YES;

}

-(NSUInteger)supportedInterfaceOrientations{

   

    return UIInterfaceOrientationMaskLandscape; //UIInterfaceOrientationMaskLandscape、UIInterfaceOrientationMaskAll、UIInterfaceOrientationMaskAllButUpsideDown

}


考虑到兼容低版本,最好加上:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

{

    return YES;

}


简单说明:

UIInterfaceOrientationMaskLandscape  支持左右横屏


UIInterfaceOrientationMaskAll  支持四个方向旋转


UIInterfaceOrientationMaskAllButUpsideDown 支持除了UpsideDown以外的旋转

补充:移动开发 , IOS ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,