开发者

Disable navigationitem backbarbutton

How do I disable the backbutton in a navigationcontroller?

When I hide the button like so, self.navigationItem.hid开发者_如何学编程esBackButton = TRUE; the buttonarea is still tappable.


If you don't need a back button and since part of navigationBar's existence is to have a back button you can simply hide the navBar. I can post the code to that if you want as Im doing that in couple of projects. Otherwise have your "bug" might not be a bug if you are calling it from the wrong place. After digging i managed to come up with this. To hide the back button use:

self.navigationItem.hidesBackButton = YES;

To hide the whole navigationBar use:

self.navigationController.navigationBarHidden = YES;

But this will happen without animation, to animate it use this instead:

[self.navigationController setNavigationBarHidden:YES animated:YES];

This will make a sliding animation together with the navigation view. You will need to provide some other means for the person to get back tho.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜