Skip to main content

Posts

Showing posts from April, 2011

Add Navigation bar background images

NOTE : Add this on the top of the delegate file before implementation of class. @implementation UINavigationBar (UINavigationBarCategory) -(void)setBackgroundImage:(UIImage*)image withTag:(NSInteger)bgTag{     if(image == NULL){ //might be called with NULL argument         return;     }     UIImageView *aTabBarBackground = [[UIImageView alloc]initWithImage:image];     aTabBarBackground.frame = CGRectMake(0,0,self.frame.size.width,self.frame.size.height);     aTabBarBackground.tag = bgTag;     [self addSubview:aTabBarBackground];     [self sendSubviewToBack:aTabBarBackground];     [aTabBarBackground release]; } /* input: The tag you chose to identify the view */ -(void)resetBackground:(NSInteger)bgTag {     [self sendSubviewToBack:[self viewWithTag:bgTag]]; } - (void)drawLayer:(CALayer *)layer inCo...