rnystrom / RNFrostedSidebar

A Control Center-esque control with blurred background and toggle animations.
MIT License
2.12k stars 340 forks source link

Embedded view doesn't resize on screen rotate when sidebar is used with NavigationController #26

Open smfeest opened 10 years ago

smfeest commented 10 years ago

I have set up a minimum test case of a iOS7 single view storyboard application where the view controller contains a single button that opens an instance of the sidebar as follows:

- (IBAction)menuButtonAction:(id)sender {
    NSArray *images = @[[UIImage imageNamed:@"gear"]];

    RNFrostedSidebar *callout = [[RNFrostedSidebar alloc] initWithImages:images];
    [callout show];
}

If I run the application and rotate the phone everything resizes correctly. However, if I then embed the view in a navigation controller and restart the application, the embedded view no longer resizes when I rotate the screen (as shown below).

sidebarrotate

I've tried replacing [callout show] with [callout showInViewController:self animated:YES]. This solves the resizing issue but causes the sidebar to appear behind the navigation bar which isn't desirable.

I am going to continue investigating, but I thought I'd post this first in case someone else has already experienced this problem.

skull-squadron commented 10 years ago

The easiest hack might be to dismiss the sidebar during a rotation. It might fix #37 as well.