2016-09-19 67 views

回答

0

不,您將不得不實施旋轉回調並將圖層自己旋轉到屏幕之前的位置。

它會是這個樣子

- (void)viewWillTransitionToSize:(CGSize)size 

withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator 
{ 

[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; 

    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) 
    { 

     UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; 

     if (orientation == UIInterfaceOrientationMaskPortrait || orientation == UIInterfaceOrientationPortrait) { 
      /// rotate layer to old orientation 

     }else{ 
      /// rotate layer to old orientation 
     } 

    } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) 
    { 


    }]; 


}