navigationItem的leftBarButtonItem和rightBarButtonItem隐藏

因为项目的需要,隐藏navigationControll上面的按钮,于是写了如下代码:

[cpp]  view plain copy
  1. self.navigationItem.leftBarButtonItem = nil;  

发现不起作用,于是有了如下的代码:

[cpp]  view plain copy
  1. self.navigationItem.hidesBackButton = YES;  
  2. self.navigationItem.rightBarButtonItem.customView.hidden=YES;

你可能感兴趣的:(navagationItem)