Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow renders incorrectly on Rotation in iOS 9 #220

Open
tommylee-fl opened this issue Jul 11, 2016 · 0 comments
Open

Shadow renders incorrectly on Rotation in iOS 9 #220

tommylee-fl opened this issue Jul 11, 2016 · 0 comments

Comments

@tommylee-fl
Copy link

We ran into issues where the shadow does not change on rotation.

Possible Solution

For us, we pulled the shadow draw methods up to the root view controller, but here's what we did:

We need to redraw the shadow on rotation.
We added a delegate method that redraws the menu on the completion of a rotation.

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
  [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
   {
   } completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
   {
        if(self.shadowEnabled) [self drawMenuShadows];
   }];

  [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}

Since we're redrawing the menu at the end of the rotation, and interfaceOrientation is deprecated at iOS 8, we could return only the width and height.

- (CGSize)sizeAdjustedForInterfaceOrientation:(UIView *)view {
        return CGSizeMake(view.frame.size.width, view.frame.size.height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant