Closed voisen closed 6 years ago
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
if (self.viewControllers.count > 0) {
UIViewController *currentLast = RTSafeUnwrapViewController(self.viewControllers.lastObject);
[super pushViewController:RTSafeWrapViewController(viewController,
viewController.rt_navigationBarClass,
self.useSystemBackBarButtonItem,
currentLast.navigationItem.backBarButtonItem,
currentLast.navigationItem.title)
animated:animated];
}
else {
[super pushViewController:RTSafeWrapViewController(viewController, viewController.rt_navigationBarClass)
animated:animated];
}
}
已解决: 上面的改动是currentLast.title
改为currentLast.navigationItem.title
你用 self.title = @"首页"
就好了
当前viewController使用
self.navigationItem.title = @"首页";
设置标题后, push新的控制器, 返回按钮与系统自带的不一样, push出来的控制器的返回title
一律为Back
而不是前一个控制器的标题