How can I pop a view from a UINavigationController and replace it with another in one operation?

后端 未结 16 2176
谎友^
谎友^ 2020-11-27 10:01

I have an application where I need to remove one view from the stack of a UINavigationController and replace it with another. The situation is that the first view creates an

16条回答
  •  渐次进展
    2020-11-27 10:26

    For monotouch / xamarin IOS:

    inside UISplitViewController class;

    UINavigationController mainNav = this._navController; 
    //List controllers = mainNav.ViewControllers.ToList();
    mainNav.ViewControllers = new UIViewController[] { }; 
    mainNav.PushViewController(detail, true);//to have the animation
    

提交回复
热议问题