UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cancel.png"]]];
button.target = picker.navigationBar.topItem.leftBarButtonItem ;
button.action = picker.navigationBar.topItem.leftBarButtonItem.action;
picker.navigationBar.topItem.leftBarButtonItem=button;
Hi folks, I'm trying to change the style of the buttons of the mail composer. The above code does change the look of the button, however the action seems to be lost. Any ideas how I can overcome this? Thanks.
The fix for this is fairly simple. You add a method to this button and then define what should happen in the method. So first, put this line after you declare your button.
That will add a method to be called when the button is clicked/touched. Then, later in the code, you create the actual method that the button will be calling.
Hope this helped :)