I've customized my Custom UINavigationBar to show a custom image (actually I crossfade between lots of images on a NSTimer) :
- (void) displayImage:(EGOImageView*)anImageView {
CABasicAnimation *crossFade = [CABasicAnimation animationWithKeyPath:@"contents"];
crossFade.duration = 0.5;
crossFade.fromValue = self.layer.contents;
crossFade.toValue = (id)[self imageFromView:anImageView].CGImage;
[self.layer addAnimation:crossFade forKey:@"animateContents"];
self.layer.contents = (id)[self imageFromView:anImageView].CGImage;
}
How do I prevent the navigationBar to loose my custom layer when enabling or disabling a barButtonItem? My navigation bar goes back to it's default state after the following line in my VC is executed:
self.navigationItem.rightBarButtonItem.enabled = !editing;
(It reverts to the UIBarStyleBlackOpaque I've set in the VC's viewDidLoad)