iOS uses push to hide sub-pages at the bottom bottom TabBar

Source: Internet
Author: User

Here are two things I encountered during the development process, one of which is code using Pushviewcontroller, and the other is storyboard using push directly. Before also consulted a lot of information about the hidden bottom tabbar, but either the use of trouble, or the high-quality code is not standardized (here a bit of code cleanliness, the current class-related transactions should be written in this class).
1. Using Pushviewcontroller
such as a->b; A is a list page, with Tabbar;b is the content page, do not need to tabbar;

Open B in the event of a, the following code

-(void) Showvideo: (Ejalbummodel *) model BYSID: (NSString *) Sid{nslog (@ "%@", @ "execute delegate"); Ejclassvideoviewcontroller *videocontroller=[[ejclassvideoviewcontroller Alloc] Init];videocontroller.model=model ; Videocontroller.semesterclassid=sid;self.navigationitem.backbarbuttonitem=[[uibarbuttonitem Alloc] initwithtitle:@ "Back" style:uibarbuttonitemstylebordered target:nil action:nil];//Modify the Back button of the downlevel page, Here I would like to write in Videocontroller, but the backbarbuttonitem mechanism decision must be written in A; [Self.navigationcontroller Pushviewcontroller: Videocontroller Animated:yes];}
in the Load view event Initwithnibname of B, add self.hidesbottombarwhenpushed=yes; open b hidden Tabbar, return a re-realistic tabbar; it's simple.

-(ID) Initwithnibname: (NSString *) Nibnameornil Bundle: (NSBundle *) nibbundleornil{self = [Super Initwithnibname: Nibnameornil bundle:nibbundleornil];if (self) {self.hidesbottombarwhenpushed=yes;} return self;}

2. Using Storyboard
Create a and B in storyboard, and use CTRL + link to B, that is, the opening of the segue, as shown in:



It is only necessary to modify a property of B in the visual view (unfortunately many technical articles do not mention this, because I did not find it), for example, check B view, and check the Hide Bottom Bar on Push;



iOS uses push to hide sub-pages at the bottom bottom TabBar

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.