I want to set a Image on UINavigationBar without using nib please help me?
please help me to set the im开发者_如何学编程age on UINavigationBar without using nib.
You have to override the - (void)drawRect:(CGRect)rect
method with something like this:
UIImage *image = [UIImage imageNamed: @"filename.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
Basically this load an image from a file and then draws it with the exact size of the UINavigationBar.
精彩评论