在父viewController中如下设置:
UIBarButtonItem*backbutton = [[UIBarButtonItem alloc]init];
backbutton.title= @"返回列表";
self.navigationItem.backBarButtonItem=backbutton;
navigationbar的back键触发其他事件
UIButton*back =[[UIButton alloc] initWithFrame:CGRectMake(200, 25, 63,30)];
[back addTarget:selfaction:@selector(reloadRowData:)forControlEvents:UIControlEventTouchUpInside];
[back setImage:[UIImageimageNamed:@"返回按钮.png"] forState:UIControlStateNormal];
UIBarButtonItem*backButtonItem = [[UIBarButtonItem alloc]initWithCustomView:back];
self.navigationItem.leftBarButtonItem=loginButtonItem
UINavigationControll采用pushViewController后如何去掉左边的返回按钮
UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItemalloc] init];
temporaryBarButtonItem.title= @"";
self.navigationItem.backBarButtonItem= temporaryBarButtonItem;
[temporaryBarButtonItemrelease];
或者self.navigationItem.hidesBackButton = YES;前者在主视图中,后者在子视图中用
push后隐藏返回按钮
push后隐藏返回按钮 self.navigationItem.hidesBackButton = YES;
push后隐藏底部条 viewController.hidesBottomBarWhenPushed = YES; 或者self.tabBarController.tabBar.hidden = YES;