iphone - UINavigationController Title not Applied -


i wondering why uinavigationcontroller not letting me set title. lets me change tint of navigationbar, title , rightbarbuttonitem set ignored. why?

here's code:

  taps = 0;    uiview*controllerview = [[uiview alloc] initwithframe:cgrectmake(0, 0, 320, 480)];    controllerview.backgroundcolor = [uicolor whitecolor];    controller = [[uiviewcontroller alloc] init];    [controller setview:controllerview];    [controllerview release];    navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:controller];    navcontroller.navigationbar.barstyle = 1;    navcontroller.navigationitem.title = @"setup";    uibarbuttonitem*item = [[uibarbuttonitem alloc] initwithtitle:@"done" style:uibarbuttonsystemitemdone target:self action:@selector(dismisssetup:)];    navcontroller.navigationitem.rightbarbuttonitem = item;    [item release];    [self presentmodalviewcontroller:navcontroller animated:yes];    [mp stop]; 

p.s: know i'm not releasing of stuff alloc'ed, later!

the navigation controller updates middle of navigation bar follows: if new top-level view controller has custom title view, navigation bar displays view in place of default title view. specify custom title view, set titleview property of view controller’s navigation item. if no custom title view set, navigation bar displays label containing view controller’s default title. string label obtained title property of view controller itself. if want display different title 1 associated the

view controller, set title property of view controller’s navigation item instead.

you want uinavigationcontroller change title depending on viewcontroller on top. way go set title in viewcontrollers pushing onto viewcontrollers array.

and way: don't think navigationcontrollers supposed presented modally:

because uinavigationcontroller class inherits uiviewcontroller class, navigation controllers have own view accessible through view property. when deploying navigation interface, must install view root of whatever view hierarchy creating. example, if deploying navigation interface itself, make view main subview of window. install navigation interface inside tab bar interface, install navigation controller’s view root view of appropriate tab.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -