开发者

Custom line color in UINavigationBar

UINavigationBars by default have a black line at the bo开发者_Go百科ttom of them, separating themselves from the content below them.

How can I change this color, or even better, completely remove the line?

Thanks in advance.


I don't think we can remove the line but we can keep our own image instead of the default navigation bar. So we can create our own image and keep it.
To do that add this code to your app Delegate.m file in the end.

@implementation UINavigationBar (BackgroundImage)

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

@end

Hope it helped...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜