Custom UINavigationController UINavigationBar

后端 未结 4 1619
眼角桃花
眼角桃花 2021-02-02 04:24

Basically I want a custom UINavigationBar. I don\'t want it to be \"translucent\" or anything, like the pictures app.

I basically want to completely remove

4条回答
  •  梦谈多话
    2021-02-02 05:15

    @implementation UINavigationBar (background)
    
    - (void)drawRect:(CGRect)rect {
        UIImage *image = [UIImage imageNamed:@"navigationbar.png"];
        [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    }
    
    @end
    

    basically, its not completely see through - its a visual lie. The only way to do it realistically is to override UINavigationBar's drawRect: method, as shown above.

提交回复
热议问题