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

Sidebar after rotate device #15

Open
alanbarboza opened this issue Feb 8, 2017 · 1 comment
Open

Sidebar after rotate device #15

alanbarboza opened this issue Feb 8, 2017 · 1 comment

Comments

@alanbarboza
Copy link

Hi Dude,
First thanks for this demo app, it's really nice.

But I've found a issue when rotate screen on iPhone 7 Plus, it preservers the top space of device.

captura de tela 2017-02-07 as 22 11 05

@miragessee
Copy link

I solved this problem like this.

menuVC.view.frame=CGRect(x: 0 - UIScreen.main.bounds.size.width, y: -32, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height);
            
            UIView.animate(withDuration: 0.3, animations: { () -> Void in
                menuVC.view.frame=CGRect(x: 0, y: -32, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height);
                sender.isEnabled = true
            }, completion:nil)
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        if UIDevice.current.orientation.isLandscape
        {
            view.frame.origin.y = 32
            view.frame.size.height += 32
        }
        else
        {
            view.frame.origin.y = 64
            view.frame.size.height -= 32
        }
    }

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

2 participants