iPhone Pushing View Controller in a left direction

前端 未结 6 1608
耶瑟儿~
耶瑟儿~ 2020-12-05 12:07

I have an app that has a centre view with two views off to each side of it. I want to have two navigation bar buttons, left and right which push a new navigation controller

6条回答
  •  孤街浪徒
    2020-12-05 12:44

    To get the "pointy" type button you need to use a different method.

    In your AppDelegate:

    UITableViewController *first = [[RootViewController alloc] initWithStyle:UITableViewStylePlain];
    UITableViewController *second = [[SomeOtherViewController alloc] initWithStyle:UITableViewStylePlain];
    
    NSArray *stack = [NSArray arrayWithObjects: first, second, nil];
    
    UINavigationController *nav = [[UINavigationController alloc] init];
    [nav setViewControllers:stack animated:NO];
    

提交回复
热议问题