问题
It's odd, I know, but even if you stated hidesBackButton to YES for the UINavigationItem associated with your view, you will be able to go back just touching the area that was meant to be a back button.
Sharing my solution... (more to come)
回答1:
First I thought it was a simulator bug and uploaded to the device. But when I reproduced the same behavior there as well I started to think how to get rid of such behavior (since it was essential for me). Came up to such a solution:
[self.navigationItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithCustomView:[[UIView new] autorelease]] autorelease]];
And to show the back button again you write:
[self.navigationItem setLeftBarButtonItem:nil];
That's simple. Use it as a work-around, guys! Very strange this bug survived even in iPhone OS 3.0...
回答2:
i think hiding back bar button also work as
self.navigationItem.hidesBackButton = TRUE;
来源:https://stackoverflow.com/questions/1232557/uinavigationitem-sethidesbackbuttonyes-wont-prevent-from-going-back