I'm adding a custom background image to my UINavigationBar by overriding the drawRect via a category.
- ( void )drawRect:( CGRect )rect{ [[UIImage imageNamed:@"navbar.png"] drawInRect:CGRectMake( 0, self.frame.size.height-44, self.frame.size.width, 44 )]; }
This solution seems to work fine, until you try to make use of navigationitem.prompt property. Instead of doing a smooth animation of presenting the prompt, it does it abruptly.
Are there any suggestions on how to remedy this ? Or an alternative way of setting a background image.
PS. I'm trying to avoid just adding a background image as a subview because of the way things rearrange when views push/pop. And I'd hate to sendSubviewToBack in every view's viewDidAppear.
TIA!
EDIT: I also tried method swizzling, which would work fine if I could just let my image stretch, but since the image isn't stretchable, I need to figure out how to tap into the animation that happens to do a shift instead of a stretch.
EDIT: see my hacky answer below