//在自定义的navigationController里面重写push方法
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if (self.childViewControllers.count>0) //非根控制器
{
viewController.hidesBottomBarWhenPushed = YES;
viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem backItemWithImage:[UIImage imageNamed:@"imageName"] hightImage:[UIImage imageNamed:@"imageName"] target:self action:@selector(back) title:@"返回"];
}
[super pushViewController:viewController animated:YES];
}
- (void)back
{
[self popViewControllerAnimated:YES];
}
网友评论