GithubHelp home page GithubHelp logo

Comments (2)

Mazyod avatar Mazyod commented on May 22, 2024

Hi @basilmariano, I am glad you liked it.

If I understand the question correctly, you are making the setNavigationBarHidden: call in a view controller that uses the shyNavBar? If that is the case, it probably won't work, since you are hiding the navigation bar anyway, why would you want to attach the shyNavBarManager to it?

If you mean the shyManager is attached to the previous controller, it should work, I just tested it myself. Make sure your call is like this:

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

Cheers,

from tlyshynavbar.

joshbernfeld avatar joshbernfeld commented on May 22, 2024

If you are pushing to a view controller that does not have a shyNavBar from a view controller that does have a shyNavBar and you are hiding the nav bar in viewWillAppear of the new controller it will not work. Here is the solution that works great for me.


- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    //We have to manually animate hiding the nav bar because TLYShyNavBar prevents
    //[self.navigationController setNavigationBarHidden:YES animated:YES]; from animating properly.
    //First animate the bar out in viewWillAppear:, then call setNavigationBarHidden: in viewDidAppear:
    //This will allow user interaction underneath where the bar would normally be.

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.25];
    self.navigationController.navigationBar.alpha = 0;
    [UIView commitAnimations];
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    [self.navigationController setNavigationBarHidden:YES animated:NO];
}


- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];

    //Prevents showing the navigation bar when moving to another of the same controller
    if (![self.navigationController.topViewController isKindOfClass:[YourViewController class]]) {
        [self.navigationController setNavigationBarHidden:NO animated:YES];

        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:0.25];
        self.navigationController.navigationBar.alpha = 1;
        [UIView commitAnimations];
    }

}

from tlyshynavbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.