如何将UITabBarController NavigationController选项卡扩展到屏幕顶部?

问题描述

我似乎无法弄清楚如何以编程方式使UITabBarController的导航控制器选项卡全屏显示。它通过情节提要板起作用,但是我需要以编程方式创建选项卡栏,并且它们会弹出,如下图所示。我希望那些没有弹出的后退箭头。

是否可以通过编程使它们全屏显示?我到处搜索,没有找到Swift的任何内容

Showing Tab Bar Nav Controller Unwanted Tab Popout

解决方法

let myViewController = UIViewController()
myViewController.modalPresentationStyle = .fullScreen // you can display in fullscreen