ios - issue in navigation bar not hiding in another view controller -
i have used code in app delegate making breathdatetableviewcontroller rootview controller
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { name =[[nsstring alloc]init]; birthdate =[[nsstring alloc]init]; phone =[[nsstring alloc]init]; email =[[nsstring alloc]init]; image =[[nsstring alloc]init]; birthdatetableviewcontroller =[[birthdatetableviewcontroller alloc]initwithnibname:@"birthdatetableviewcontroller" bundle:nil]; navcontroller1 = [[[uinavigationcontroller alloc]initwithrootviewcontroller:birthdatetableviewcontroller]autorelease]; [window addsubview:navcontroller1.view]; [window makekeyandvisible]; [fbprofilepictureview class]; [[uiapplication sharedapplication]setstatusbarstyle:uistatusbarstyleblackopaque]; self.databasename = @"birthdatedatabase.sqlite"; nsarray *documentpaths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentdir = [documentpaths objectatindex:0]; self.databasepath = [documentdir stringbyappendingpathcomponent:self.databasename]; [self createandcheckdatabase]; // sleep(5); if (sqlite3_open([[self datafilepath] utf8string], &database1) != sqlite_ok) { sqlite3_close(database1); nslog(@"failed open db."); } else nslog(@"open db"); return yes; } so solving problem try remove navigation bar , putting following code make brithdatetableviewcontroller root view controller
self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; // override point customization after application launch. self.birthdatetableviewcontroller = [[birthdatetableviewcontroller alloc] initwithnibname:@"birthdatetableviewcontroller" bundle:nil]; self.window.rootviewcontroller = self.birthdatetableviewcontroller; [self.window makekeyandvisible]; but when use going in brithdatetableviewcontroller not working
so lets stick did before how can negivation bar should display when in rootview should hide when goes viewcontroller , viewcontroller have there own nevigationbar , buttons.
i tried hide in viewcontroller , thats not working here.
please suggest should come on this?
in viewcontroller
- (void)viewwillappear:(bool)animated { // if wnat navigation bar [self.navigationcontroller setnavigationbarhidden:no]; // else if don't want [self.navigationcontroller setnavigationbarhidden:yes]; }
Comments
Post a Comment