Problem pushing multiple view controllers onto navigation controller stack

后端 未结 2 1515
旧时难觅i
旧时难觅i 2020-12-15 21:39

I am trying to push three view controllers onto the navigation controller.

  [self.navigationController pushViewController:one animated:YES];
  [self.naviga         


        
2条回答
  •  暖寄归人
    2020-12-15 22:03

    For the first two pushes, don't pass the animated flag in as YES, set it to NO:

    [self.navigationController pushViewController:one animated: NO]; 
    [self.navigationController pushViewController:two animated: NO];
    [self.navigationController pushViewController:three animated: YES];
    

    This will give you the effect you want. Otherwise, you're confusing the animation system, as it tries to animate three views into the same space.

提交回复
热议问题