以下是我改变方向时所做的事情......
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if((self.interfaceOrientation == UIDeviceOrientationPortrait) || (self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown))
{
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"auto_main_hor.png"]]];
[UIView commitAnimations];
} else if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight))
{
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"auto_main_vert.png"]]];
}
}
当我将设备急剧旋转180度时,我得到了一些错误的显示?我该如何解决?
答案 0 :(得分:1)
请注意,UIInterfaceOrientation
和UIDeviceOrientation
不是一回事。您正在使用设备方向,您应该使用界面方向。