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

NavigationController back button not hiding #561

Closed
peersocialdeal opened this issue Oct 20, 2016 · 6 comments
Closed

NavigationController back button not hiding #561

peersocialdeal opened this issue Oct 20, 2016 · 6 comments
Assignees

Comments

@peersocialdeal
Copy link

Hi :)

First of all, I really love this kit! <3

So, I'm developing an app right now. But I can't seem to figure out how I can hide the "default" back button on the navigation bar.

My setup (everything programmatically):

NavigationController -> ViewController
-> push
(NavigationController) -> NavigationDrawerController -> XLPagerTabStrip* -> ViewControllers

I removed the styling so I could start from scratch. It didn't help.

In my NavigationDrawerController viewDidAppear:
(tried them all)
navigationItem.leftItemsSupplementBackButton = true
navigationItem.hidesBackButton = true

navigationItem.setHidesBackButton(true, ... )

Screenshot (ViewController): http://sup.urb.li/2iMm
Screenshot (ViewControllers + XLPagerTabStrip + DrawerController): http://sup.urb.li/18b5g

https://github.com/xmartlabs/XLPagerTabStrip

PS: I'm not sure this is an issue, but it's my issue.

Help is appreciated :)

Thanks

@daniel-jonathan
Copy link
Member

@peersocialdeal I love this line "PS: I'm not sure this is an issue, but it's my issue."

I think your setup is a bit off. You don't need to manually hide the back button. That is all done within the framework. In your AppDelegate you should have a setup like this:

window!.rootViewController = NavigationDrawerController(rootViewController: NavigationController(rootViewController: PageTabBarController(viewController: [VC1, VC2, ...])))

The other thing to note, is if you are looking to use the NavigationController because you want the look and feel, but not necessarily the actual navigation benefits, I would opt in to use the ToolbarController instead. It will give you the same look and feel, but is more simple in its usage.

To access the Material back button, in the page you want to access it, you should be able to do this

navigationItem.backButton.isHidden = true

After writing all this, I think this would be a great example, so I am going to make one with this setup. It will be out later today.

And thank you very much for your support, we love working on Material :)

I will leave this issue up as a request for a sample.

@peersocialdeal
Copy link
Author

peersocialdeal commented Oct 20, 2016

Awesome fast response ! 👍

Yea, I figured my setup is that well.

I'm kinda new to iOS dev, so this is my first "real" project. So still figuring out some things.

The way the drawer works now is to "replace" the page on the drawer root.
But the way I'm supposed to make it work is leaving the drawer to a new history item in the navigation history stack.

screenshot: http://sup.urb.li/1avf5

top drawing is how I'm supposed to make it.
bottom drawing is how the drawer is working now, and supposed too work.

Back on topic
http://sup.urb.li/1hMol
3th is not hiding with leftViews
while hidesBackbutton = true and
hidesBackButtonOnLeftViewsSuplement = true (don't remember real property name)

Thanks

@daniel-jonathan
Copy link
Member

Let's close this issue and move it to Gitter so we can chat more freely on how to approach setting up your app architecture. Ping me there when you are ready.

@daniel-jonathan
Copy link
Member

Hey, I started a samples project repository where I will make samples based on requests and needs. Here is your issue CosmicMind/Samples#1 :) We can chat there.

@phlippieb
Copy link
Contributor

Was this solved? I couldn't figure out how to do this from the sample issue.

@daniel-jonathan
Copy link
Member

@phlippieb Yes, take a look here CosmicMind/Samples#1, and look at this sample CardTableView.

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

No branches or pull requests

3 participants