iOS7 - Change UINavigationBar border color

后端 未结 15 2057
时光取名叫无心
时光取名叫无心 2020-12-07 14:44

Is it possible to change the grey border-bottom color of the UINavigationBar in iOS7?

I already tried to remove to border, but this is not working:

[         


        
15条回答
  •  情歌与酒
    2020-12-07 15:14

    Here is another way:

    CALayer *border = [CALayer layer];
    border.borderColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"border"]].CGColor;
    border.borderWidth = 1;
    CALayer *layer = self.navigationController.navigationBar.layer;
    border.frame = CGRectMake(0, layer.bounds.size.height, layer.bounds.size.width, 1);
    [layer addSublayer:border];
    

提交回复
热议问题