如何删除导航栏按钮项目
How to delete Navigation Bar Button Item
我正在使用以下代码以编程方式推送 ViewController:
LoginInfoVC *nextScr = (LoginInfoVC *) [self.storyboard instantiateViewControllerWithIdentifier:@"LoginInfoVC"];
[self.navigationController pushViewController:nextScr animated:YES];
在我的 LoginInfoVC didLoad 方法中,我使用此代码删除后退按钮
但它不起作用:
self.navigationItem.leftBarButtonItem = nil;
我也用过这个代码:
self.navigationItem.leftBarButtonItem.enabled = NO;
我也关注了this,但对我没有帮助。
使用这个
[self.navigationItem setHidesBackButton:YES animated:NO];
我正在使用以下代码以编程方式推送 ViewController:
LoginInfoVC *nextScr = (LoginInfoVC *) [self.storyboard instantiateViewControllerWithIdentifier:@"LoginInfoVC"];
[self.navigationController pushViewController:nextScr animated:YES];
在我的 LoginInfoVC didLoad 方法中,我使用此代码删除后退按钮 但它不起作用:
self.navigationItem.leftBarButtonItem = nil;
我也用过这个代码:
self.navigationItem.leftBarButtonItem.enabled = NO;
我也关注了this,但对我没有帮助。
使用这个
[self.navigationItem setHidesBackButton:YES animated:NO];