Skip to content

LivenBom/LERotationManager

Repository files navigation

LERotationManager

完整文章

-----2020年06月16日 更新

勘误:项目info.plist的横竖屏必须设置成只支持竖屏的,而appdelegate设置支持横竖屏,避免在没锁屏时,在手机设备横屏的时候,打开app导致只支持竖屏的页面,变成横屏,详情请到完整文章查阅

-------------------------------------- 我是分割线 --------------------------------------

轻松实现横竖屏切换

使用方法

(1)将LERotationManager添加到项目中

image-20200615154701929

(2)设置支持旋转的方向(勘误修正后)

第一:在info.plist文件或者General中设置成只支持竖屏

image-20200616171924199

第二:在AppDelegate中设置同时支持横竖屏

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    return UIInterfaceOrientationMaskAllButUpsideDown;
}

(3)创建RotationManager对象,并设置将要旋转的UIView

image-20200615155142138

(4)触发rotate方法,实现横竖屏切换

About

轻松实现横竖屏切换

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published