Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Navigation Bar Images

Tags:

iphone

I'd like to replace the back button and the entire navigation bar in my iPhone app with custom images. First of all, is this possible? Second, if so, how? Thanks.

like image 761
leafeater Avatar asked Dec 03 '22 15:12

leafeater


1 Answers

This code will modify every UINavigationBar in your app.

@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed: @"MyNavigationBar.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
like image 123
pierre Avatar answered Dec 16 '22 17:12

pierre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!