MXRotationManager
has only one line code to help you change device orientation!
UIDeviceOrientationLandscapeLeft | UIDeviceOrientationLandscapeRight |
---|---|
implementation delegate method below in AppDelegate.m
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [MXRotationManager defaultManager].interfaceOrientationMask;
}
[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeLeft;
[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeRight;
MXRotationManager
一行代码控制设备旋转方向
UIDeviceOrientationLandscapeLeft | UIDeviceOrientationLandscapeRight |
---|---|
在 AppDelegate.m
里 实现 AppDelegate
代理方法
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [MXRotationManager defaultManager].interfaceOrientationMask;
}
[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeLeft;
[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeRight;