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