Material: Need help with component flow.

Created on 8 Sep 2018  路  8Comments  路  Source: CosmicMind/Material

Hello @danieldahan. I'm trying to make a tab based app with a navigation bar and a navigationdrawermenu. So far i have succeeded in implementing the following flow -

  • BottomNavigationController -> NavigationController -> ViewController

Now Im trying to include a navigationDrawer but so far I have failed. Any suggestions will be appreciated. P.S. I'm using storyboard, mostly.

help wanted material

All 8 comments

Hey! For questions, use stackoverflow with cosmicmind tag or our gitter channel

For NavigationDrawerController you'll have to define your hierarchy in code, see NavigationDrawerController sample

I have tried to work it like this -

window = UIWindow.init(frame: Screen.bounds)

let homeVc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "HomeViewController")

let drawerControllerVC = AppNavigationDrawerViewController(rootViewController: HomeNavigationController(rootViewController: homeVc), leftViewController: nil, rightViewController: DrawerViewController())

window?.rootViewController = AppTabViewController(viewControllers: [drawerControllerVC, SearchMediaViewController()])

But this happens. The black cut off.
screen shot 2018-09-08 at 6 12 18 pm

Also the drawer menu comes under the tabbar.
screen shot 2018-09-08 at 6 12 29 pm

NavigationDrawerController should be the topmost controller generally.

let homeVc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "HomeViewController")

let tabsVc = AppTabViewController(viewControllers: [HomeNavigationController(rootViewController: homeVc), SearchMediaViewController()])
window?.rootViewController =  AppNavigationDrawerViewController(rootViewController: tabsVC, leftViewController: nil, rightViewController: DrawerViewController())

you're an angel @OrkhanAlikhanov . bless you man. another minor thing. everything is as I want them to be but when the drawer opens the status bar in the back gets disappeared. when i close the drawer it comes back again.

Hey! No need to overpraise me :) Thank you for your appreciation.

You can set isHiddenStatusBarEnabled to false. Default value is true.

@OrkhanAlikhanov Thank you!

hi. im using NavigationDrawerController. I have a right view that comes out when i press the menu button. how can i close the right view when i tap to the left part past the right view.

@CHONUMAN Hey, we you can call navigationDrawerController?.closeRightView(). It's available for leftView as well. You can check NavigationDrawerController.swift out for more info.

Was this page helpful?
0 / 5 - 0 ratings