Skip to content

Latest commit

 

History

History
executable file
·
34 lines (27 loc) · 831 Bytes

README.md

File metadata and controls

executable file
·
34 lines (27 loc) · 831 Bytes

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];
}