项目介绍:
MXRotationManager
一行代码控制设备旋转方向
屏幕截图
UIDeviceOrientationLandscapeLeft | UIDeviceOrientationLandscapeRight | |
---|---|---|
如何使用
在 AppDelegate.m
里 实现 AppDelegate
代理方法
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [MXRotationManager defaultManager].interfaceOrientationMask;
}
UIDeviceOrientationLandscapeLeft
[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeLeft;
UIDeviceOrientationLandscapeRight
[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeRight;