iPhone UINavigationBar custom look and feel -
An attempt to know how to display a background image behind a UINavigationBar
on my iPhone The app and the same solution have appeared many times as follows:
@implementationUINavigationBar (UINavigationBarCategory) {- (draw) zeroRect: (CGRect) rect {UIImage * img = [ UIImage imageNamed: @ "logo_bar.png"]; CGContextRef Reference = UIGraphicsGetCurrentContext (); CGContextDrawImage (Reference, CGRectMake (0, 0, 317, 27), img.CGImage); } @ And
that works for the degree
My image is upside down and back !! Why would this happen on earth? I have examined this image myself which is fine.
How can I choose to show BG image or toggling it Can alpha on selected screen? A special screen where there is a back button and the image is covered in it, which I do not want, I would not want to display the image on that screen.
The image is not the full height of this UINavigationBar
, it has a small piece (as you can see 27). How can I keep tint color in the rest of the bar using this technique?
Thank you, I have not used those categories before I have the key to understanding this, but probably not ...
// drawing code CGContextRef c = UIGraphicsGetCurrentContext (); UIImage * back = [UIImage imageNamed: @ "barcode"]; CGContextScaleCTM (c, 1, -1); CGContextTranslateCTM (c, 0, -44); CGContextDrawImage (c, CGRectMake (0, 0, 320, 44), [back CGImage]);
In this way I draw my custom navigation bar. I hope that helps.
Comments
Post a Comment