开发者

How to hide the backbutton in uinavigationcontroller

I tried to remove the backbutton of uinavigationcontroller by using

appdelegate.navigationController.navigationItem.hidesBackButton=YES;

but it does not remove the backbutton after the pushing a new viewcontroller into navigation stack.How to hide th开发者_运维知识库is?


In the view controller's viewDidLoad method that you want to hide the back button:

self.navigationItem.hidesBackButton = YES;


Your above line is wrong. do it with :

 self.navigationController.navigationItem.hidesBackButton = TRUE;


You can write this in your ViewDidLoad as well as in ViewWillAppear method:

self.navigationItem.hidesBackButton = YES;


The existing answers didn't work for me. I found that the best way for me was:

self.navigationItem.leftBarButtonItems = [NSArray array];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜