Good stickers--ios-about Uinavigationcontroller title does not display the problem

Source: Internet
Author: User

Create a class with inherit from Uinavigationcontroller and Uitabbarcontroller, set the former to Rootviewcontroller, there is a problem, Navigetioncontroller title does not show, in controller inside how to set not display, The reason is this: Title This property is actually belong to Uiviewcontroller and not belong to Uinavigationcontroller. So, this attribute is inherited from the uiviewcontroller above. Rather than uinavigationcontroller the name above. Since Uinavigationcontroller belong to a container, you need at least one rootcontroller. Then set the title in Rootcontroller's viewdidload instead of the subclass in Uinavigationcontroller. and Viewdidload set the title is unified display, the Navigation view control of the title of the Uiviewcontroller is the same, my solution is: the logical replacement, Uitabbarcontroller is set to Rootviewcontroller,
1-(void) Addtage: (Class) controller addname: (NSString *) name AddImage: (NSString *) image addselectimage: (NSString *) Selectimage2 3 {4 5     6 7Uiviewcontroller *VC =[[Controller alloc] init];8 9Uinavigationcontroller *citynav =[[UINAVIGATIONCONTROLLERALLOC]INITWITHROOTVIEWCONTROLLER:VC];Ten  OneCityNav.tabBarItem.image =[UIImage imagenamed:image]; A  -CityNav.tabBarItem.selectedImage =[UIImage imagenamed:selectimage]; -  theCityNav.navigationBar.backgroundColor =[Uicolor Bluecolor]; -  -CityNav.tabBarItem.title =name; -  +CityNav.navigationBar.barStyle =Uibarstyledefault; -  +CityNav.navigationBar.barTintColor =[Uicolor Cyancolor]; A  at [Self.navarray Addobject:citynav]; -  -      -  - } -  in   -  toSelf.tabBarController.viewControllers =Self.navarray; +  -   theSelf.window.rootViewController = Self.tabbarcontroller;

Good stickers--ios-about Uinavigationcontroller title does not display the problem

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.