Search code examples
iphonexcodebackbarbuttonitem

how to change the color of backBarButtonItem?


In my application I want to change the color of bacBarButtonItem. Is it possible to change the color? or I have to put an image of it. and in case of image tell me the code how to put the image.


Solution

  • UIImage *image = [UIImage imageNamed:@"imageName.png"];
    UIBarButtonItem* backBarButton = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(backButtonAction)];
    self.navigationItem.leftBarButtonItem=backBarButton;
    [backBarButton release];