iOS Home controller jump Hide Tabbar on bottom of app

Source: Internet
Author: User

When you find the app jumping from the home controller to the next N-level controller one day, you need to hide the bottom tabar.

Looking for a half-day data, found that the controller has a property called hidesbottombarwhenpushed, but do not know how

First, add a classification method to the controller Uiviewcontroller:

-(void) Pushviewcontroller: (nonnull uiviewcontroller *) Viewcontroller {

viewcontroller.hidesbottombarwhenpushed = YES;
[Self.navigationcontroller Pushviewcontroller:viewcontroller Animated:yes];
}

When you want to jump to call this method has no effect, after I changed to the following:

-(void) Pushviewcontroller: (nonnull uiviewcontroller *) Viewcontroller {
self.hidesbottombarwhenpushed = YES;
[Self.navigationcontroller Pushviewcontroller:viewcontroller Animated:yes];
self.hidesbottombarwhenpushed = NO;
viewcontroller.hidesbottombarwhenpushed = YES;
}

Perfect solution, then changed the way: Custom a xquinavigationcontroller inherit from Uinavigaitoncontroller, in the inside rewrite the following method:

-(void) Pushviewcontroller: (Uiviewcontroller *) Viewcontroller animated: (BOOL) animatetd

{

if (Self.childViewControllers.count > 0)//non-root controller

{

viewcontroller.hidesbottombarwhenpushed = YES;

}

[Super Pushviewcontroller:viewcontroller animated:animated];

}

Then the Tabbarcontroller root controller is also perfectly solved using Xquinavigationcontroller.

iOS Home controller jump Hide Tabbar on bottom of app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.