iOS中锁定屏幕的方法
在父级视图中实现
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return (toInterfaceOrientation==UIInterfaceOrientationPortrait);
}
-(BOOL)shouldAutorotate
{
returnNO;
}
-(NSUInteger)supportedInterfaceOrientations
{
returnUIInterfaceOrientationMaskPortrait;
}
便可以锁定屏幕为横屏
浙公网安备 33010602011771号