I am newbie for iPhone application.
What I have is as below.
UIBarButtonItem *flipButton = [[UIBarButtonItem alloc]
initWithTitle:@"Flip"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(flipView)];
self.navigationItem.leftBarButtonItem = flipButton;
[flipButton release];
BUT, problem is button design. It is just square button.
How can I make this button to same as Back button?
Any idea/ suggestion would be appreciated.
I was trying with
self.navigationItem.leftBarButtonItem.title = @"Back";
self.navigationController.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(goBackToSAMA:)] autorelease];
but its working working. Not working means, goBackToSAMA is not getting invoked and button text is also not coming to Back.
As far as I know, ther is only one way how to display the standard back button. You have to push
UINavigationIteminUINavigationBar. Or better: there need to be navigation item to be popped.IMPORTANT: This will not work nice with
UINavigationController‘s bar, so use your own!This code will display “Something” as a title and to the left, there will be back button saying “Go Back”. By default it shows the title of previous item, but you can customize it:
Note that the target and selector are
nil. You can not customize the action of back button like this, because it is special. You will need to implement protocolUINavigationBarDelegateand this method:Or just use custom background image…
