NavigationBar nicht angezeigt properling wenn pushViewController

Das problem ist ziemlich einfach zu verstehen mit den Bildern.
Ich habe einen UINavigationController, mit denen der Benutzer wechseln zwischen Ansichten.

Die erste Ansicht enthält eine Suchleiste und eine Tabelle anzeigen, etwa so :NavigationBar nicht angezeigt properling wenn pushViewController

Die zweite ist eine grundlegende Ansicht, wo Informationen über die Zelle sind display

Wenn ich auf das Suchfeld, der navigation-controller wird ausgeblendet, und die Suchleiste ist nun an der Spitze.

Nun, wenn ich auf eine Zelle klicken, geht es auf den zweiten Blick auf, aber die Navigationsleiste wird zunächst ausgeblendet wie unten :

NavigationBar nicht angezeigt properling wenn pushViewController

Dann, es wird automatisch angezeigt, wie :

NavigationBar nicht angezeigt properling wenn pushViewController

Ich habe versucht, ein paar Dinge wie blenden Sie die Navigationsleiste ein, bevor Sie die nächste view-controller, aber es ist ziemlich hässlich..
Weiß jemand, wie man die Karte in der Navigationsleiste direkt auf den zweiten Blick (wie in der Kontakt-Anwendung)?

[UPDATE] : Code

AppDelegate.m (ich spreche navigationcontroller2)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{    
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    FirstViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
    SecondViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];

    viewController1.managedObjectContext = [self managedObjectContext];
    viewController2.managedObjectContext = [self managedObjectContext];
    viewController1.viewController2 = viewController2;

    UINavigationController *navigationcontroller1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
    [navigationcontroller1.navigationBar setTintColor:[UIColor lightGrayColor]];
    UINavigationController *navigationcontroller2 = [[UINavigationController alloc] initWithRootViewController:viewController2];
    [navigationcontroller2.navigationBar setTintColor:[UIColor lightGrayColor]];

    self.tabBarController = [[UITabBarController alloc] init];
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationcontroller1, navigationcontroller2, nil];

    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];

    return YES;
}

FirstView.m

- (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar {
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (!noResultsToDisplay) {
        PinDetailsViewController *pinDetailsViewController = [[PinDetailsViewController alloc] initWithNibName:@"PinDetailsViewController" bundle:nil];
        NSManagedObject *managedObject = [fetchedResultsController objectAtIndexPath:indexPath];
        Pin *pin = (Pin *) managedObject;

        [self.navigationItem setTitle:@"Pins"];
        [self.navigationController pushViewController:pinDetailsViewController animated:YES];
        [pinDetailsViewController updateWithPin:pin];
    }
}

Wenn Sie etwas anderes benötigen, einfach Fragen, aber ich denke, es ist alles da.

  • Poste bitte etwas code. Ansonsten ist es sehr schwierig zu sehen, wo das problem ist.
Schreibe einen Kommentar