Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 2 KB

README.md

File metadata and controls

65 lines (42 loc) · 2 KB

MXRotationManager

MXRotationManager has only one line code to help you change device orientation!

Screenshots

UIDeviceOrientationLandscapeLeft UIDeviceOrientationLandscapeRight

How To Use

implementation delegate method below in AppDelegate.m

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    return [MXRotationManager defaultManager].interfaceOrientationMask;
}

UIDeviceOrientationLandscapeLeft

[MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeLeft;

UIDeviceOrientationLandscapeRight

    [MXRotationManager defaultManager].orientation = UIDeviceOrientationLandscapeRight;

中文介绍

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;