标签:ios 导航栏 移除导航栏按钮 uibarbuttonitem
写一个小问题,如何将navigationBar上的左边按钮移除,实现起来有两种方式,这两种方式都可以达到要求
UIButton *button = [UIButton buttonWithType:UIButtonTypeContactAdd];
button.frame = CGRectMake(0, 0, 30, 30);
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = barButton;
#if 0
//第一种
self.navigationItem.leftBarButtonItem = nil;
#else
//第二种
[self.navigationController.navigationBar.subviews.lastObject setHidden:YES];
#endif
标签:ios 导航栏 移除导航栏按钮 uibarbuttonitem
原文地址:http://blog.csdn.net/lu_ca/article/details/46563773