Skip to content

goodcyg/OSLPDemo

Repository files navigation

iOSLPDemo

横竖屏切换的例子 image

image

image

AppDelegate

- (UIInterfaceOrientationMask)application:(UIApplication *)application
  supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return [YGRotation sharedInstance].orientationMask;
}

使用例子

 
#pragma mark - 横屏
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor redColor];
    [[YGRotation sharedInstance] rotationLandscape];
}   
#pragma mark - 竖屏
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [[YGRotation sharedInstance] rotationPortrait];
}


About

iOS 横竖屏切换的例子

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published