我使用IF语句来检测设备的方向何时发生更改以及何时发生,会显示一个新视图,一个肖像,另一个环境。唯一的问题是,如果我从肖像旋转到风景,并且风景视图显示,它并未一直旋转。它仍然是肖像,它应该是90度。谢谢你的帮助!视图不能正确旋转
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
//portrait
self.view = portrait;
} else {
//landscape
self.view = landscape;
}
}
完美,谢谢! –