0

How can I change the image of Bar Button of emailcomposer in iPhone app? I am able to change the image of the Navigation Bar but I also have to change the image of Send and cancel button.

  • http://stackoverflow.com/q/8714802/1059705 just see this link, may be helpful but you can change the color of the button in this way [[yourMailComposeView navigationBar] setTintColor:yourColor]; – Bala Oct 22 '12 at 08:48

2 Answers2

2

the composer is presented modally as rootviewcontrolelr of a navigation controller.

If you change properties of UINavigationCar as well UIBarButtonItem with appearance, it should do the trick

UIBarButtonItem *barbuttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonItemStyleBordered target:nil action:nil];

if ([barbuttonItem respondsToSelector:@selector(setTintColor:)]) {
    [[UIBarButtonItem appearance] setTintColor:kUIBarButtonItemTitleColor];
}

But keep in mind that this will change all bar button items not only the ones in mail composer.

Ilker Baltaci
  • 11,644
  • 6
  • 63
  • 79
  • 2
    Perhaps it's possible to limit the style change to just a certain class (`appearanceWhenContainedIn ...`, see this link: http://stackoverflow.com/questions/8257556/ios-5-curious-about-uiappearance – Wolfgang Schreurs Oct 22 '12 at 08:49
0

Try accessing them through mailComposeViewController.navigationBar.items, which is an array of the bar items.

Manish Agrawal
  • 10,958
  • 6
  • 44
  • 76