iOS中锁定屏幕的方法

在父级视图中实现

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

{

    return (toInterfaceOrientation==UIInterfaceOrientationPortrait);

}

 

-(BOOL)shouldAutorotate

{

    returnNO;

}

 

-(NSUInteger)supportedInterfaceOrientations

{

    returnUIInterfaceOrientationMaskPortrait;

}

 

便可以锁定屏幕为横屏

posted @ 2013-03-30 20:08  yw415  阅读(327)  评论(0)    收藏  举报