AKSwiftSlideMenu icon indicating copy to clipboard operation
AKSwiftSlideMenu copied to clipboard

Sidebar after rotate device

Open alanbarboza opened this issue 8 years ago • 1 comments

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

alanbarboza avatar Feb 08 '17 00:02 alanbarboza

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

miragessee avatar Feb 08 '17 11:02 miragessee