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

After transition occurs in NavigationDrawerController, black view cover entire screen. #592

Closed
jjmean2 opened this issue Nov 9, 2016 · 2 comments
Assignees

Comments

@jjmean2
Copy link

jjmean2 commented Nov 9, 2016

Hi. I like your work. I appreciate this nice library.

I'd like to report an issue. I have an issue using NavigationDrawerController.
When I make transition from NavigationDrawerController with method transition(to:duration:options:animations:compeltion:), screen-sized black view comes up to front and cover entire screen. Please see screenshot below.

2016-11-09 14_31_45

I tried to debug with Xcode, and I think that black view is contentViewController's view of NavigationDrawerController. In RootController's transition method, it puts new root-view-controller's view back in RootController, behind contentViewController's view.

I'm using Xcode 8.1, and tested in iPhone Simulator 7 Plus
the version of Material I used is 2.3.6

This is some of setting code in test application.
I made view controllers in main.storyboard, and instantiated them in AppDelegate.

// in AppDelegate.swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
        let orangeViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as! OrangeViewController
        let leftDrawerController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LeftDrawerController") as! LeftDrawerController
        let rightViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "RightViewController") as! RightViewController
        
        let rootController = NavigationDrawerController(rootViewController: orangeViewController, leftViewController: leftDrawerController, rightViewController: rightViewController)
        
        let window = UIWindow(frame: UIScreen.main.bounds)
        window.rootViewController = rootController
        window.makeKeyAndVisible()
        self.window = window
        self.rootController = rootController
        
        
        return true
    }
// in OrangeViewController.swift (Main View Controller)
class OrangeViewController: UIViewController {

    @IBAction func tapButton(_ sender: UIButton) {
        let blueViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "BlueViewController") as! BlueViewController
        blueViewController.view.alpha = 0
        AppDelegate.shared.rootController.transition(to: blueViewController,
                                                     duration: 1,
                                                     options: [],
                                                     animations: {
                                                        blueViewController.view.alpha = 1
        },
                                                     completion: nil)

    }
}

Thanks!

@daniel-jonathan
Copy link
Member

Hey, sorry about that, this was a regression. Please find a fix in Material 2.3.7 :) Thank you!

@jjmean2
Copy link
Author

jjmean2 commented Nov 9, 2016

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants