iOS监听设备旋转方向
2015-07-04 本文已影响758人
小黄人写代码
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (self.interfaceOrientation == UIDeviceOrientationPortrait) {
NSLog(@"竖直");
} else if (self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) {
NSLog(@"水平向左");
} else if(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) {
NSLog(@"水平向右");
}
}