Wednesday, 27 February 2019

SideMenu by jonkykong Scale Animation Causes Layout Issues on Presentation

In my app, I'm using the SideMenu framework by jonkykong with the .menuSlideIn present mode and a scale factor of 0.9. For the most part, it works as expected. Unfortunately, as you can see in this video, the tab bar and navigation bar shrink on presentation of the side menu.

On devices without rounded corners, the regular 44pt tab bar works fine, however the navigation bar is still an issue. As shown in the video, the tab bar and navigation bars correct themselves when the view controller begins to dismiss.

My configuration code is as follows:

    private func configurePortfolioSelectionNavigationController() {
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        guard let portfolioSelectionNavigationController = storyboard.instantiateViewController(withIdentifier: "PortfolioSelectionNavigationController") as? UISideMenuNavigationController else {
            return
        }
        guard let portfolioSelectionViewController = portfolioSelectionNavigationController.topViewController as? PortfolioSelectionViewController else {
            return
        }

        portfolioSelectionViewController.delegate = self

        portfolioSelectionNavigationController.menuWidth = UIScreen.main.bounds.width * 0.75
        self.portfolioSelectionNavigationController = portfolioSelectionNavigationController

        let sideMenuManager = SideMenuManager.default
        sideMenuManager.menuLeftNavigationController = portfolioSelectionNavigationController
        sideMenuManager.menuAddPanGestureToPresent(toView: self.view)
        sideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view, forMenu: .left)
        sideMenuManager.menuFadeStatusBar = false
        sideMenuManager.menuPresentMode = .menuSlideIn
        sideMenuManager.menuAnimationTransformScaleFactor = 0.9
    }

It should be noted that this is only an issue when changing the scale factor. Other animation types work fine.



from SideMenu by jonkykong Scale Animation Causes Layout Issues on Presentation

No comments:

Post a Comment