在summary中的 supported devices orientation中设置所支持的屏幕旋转方式在实际RUN时并不会应用所选项目,正确的禁止屏幕旋转方向以及自定义屏幕旋转方式要在viewcontrol.m文件中的
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 方法中作适当的更改
默认是禁止
UIInterfaceOrientationPortraitUpsideDown
如果你只需显示
UIInterfaceOrientationPortrait 则可以使用 if else 语句来作相应的更改
for example :
if (interfaceOrientation == UIInterfaceOrientationPortrait) {
return YES;
}else {
return NO;
}
方式二: 删除这个方法....- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation