How to change the border color below the navigation bar?

前端 未结 6 1916
甜味超标
甜味超标 2020-12-28 19:40

Can anyone advise me on how the border below the navigation bar can be changed?

\"enter

6条回答
  •  不思量自难忘°
    2020-12-28 20:31

    I do not think there is a method to change the border color of the navigation color, other than the tintColor property of the UINavigationBar.

    I would suggest that you create a UIView of that border size and place it below the navigation bar / add it as a subView.

    UIView *navBorder = [[UIView alloc] initWithFrame:CGRectMake(0,navigationBar.frame.size.height-1,navigationBar.frame.size.width, 1)]; 
    
    // Change the frame size to suit yours //
    
    [navBorder setBackgroundColor:[UIColor colorWithWhite:200.0f/255.f alpha:0.8f]];
    [navBorder setOpaque:YES];
    [navigationBar addSubview:navBorder];
    [navBorder release];
    

提交回复
热议问题