在 UISideMenuNavigationController 的 TableViewController child 上设置导航项标题不起作用
Set navigation item title on a TableViewController child of UISideMenuNavigationController not working
我正在尝试以编程方式为我的 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 上没有侧边菜单时,它起作用了。
当我创建自定义 UITableViewController 并将其设置为故事板上 Table 视图控制器的视图控制器时,它起作用了。
我正在尝试以编程方式为我的 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 上没有侧边菜单时,它起作用了。
当我创建自定义 UITableViewController 并将其设置为故事板上 Table 视图控制器的视图控制器时,它起作用了。