我正在尝试以编程方式为我的rootViewController设置标题,但它无效。
func configurarMenuRightNavigationController() {
SideMenuManager.menuFadeStatusBar = false
let menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: "RightMenuNavigationController") as! UISideMenuNavigationController
//let menuRightNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration
// of it here like setting its viewControllers. If you're using storyboards, you'll want to do something like:
SideMenuManager.menuRightNavigationController = menuRightNavigationController
SideMenuManager.menuRightNavigationController?.viewControllers[0].navigationItem.title = "Teste"
SideMenuManager.menuPresentMode = .viewSlideOut
}
标题不会改变。
当我在常规UINavigationController上尝试没有Side Menu的另一个项目时,它可以正常工作。
答案 0 :(得分:0)
当我创建自定义UITableViewController并将其设置为故事板上的表视图控制器的视图控制器时,它工作正常。