为什么导航标题隐藏在ios13中?

当我使用PushViewController添加时,通过以下代码可以看到导航标题:

View viewp = new View();
NavigationController.PushViewController(viewp,false);

但是当我使用PresentViewControllerAsync添加导航标题时,它是隐藏的吗?

viewp.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
this.PresentViewController(viewp,true,null);  

我正在使用ios13,我怎么了? 左右按钮不显示

为什么导航标题隐藏在ios13中?

li74686771 回答:为什么导航标题隐藏在ios13中?

它们没什么问题,这是正常现象。

  • PushViewController 需要Root View Controller是NavigationController,它只能在NavigationController中使用。因此,在调用need时,如下所示:

    NavigationController.PushViewController(xxx)

这也是通过此方法可以看到导航栏的原因。下一页位于导航控制器下。查看定义的UINavigationControllerpushViewController:animated:

enter image description here

  • 但是,无论根视图控制器是NavigationController还是Other控制器,都可以调用 PresentViewController 。它只是在对话框控制器的窗口中显示一个视图控制器。然后,在下一个视图中将不会显示导航栏,因为它不在导航控制器堆栈的堆栈下方。

enter image description here

这里有一些很好的讨论,以供参考。

Difference between pushViewController and showViewController

difference between presentViewController and UINavigationController?

本文链接:https://www.f2er.com/3126294.html

大家都在问