本文介绍了如何更改导航栏下方的边框颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我如何更改导航栏下方的边框吗?
Can anyone advise me on how the border below the navigation bar can be changed?
我想将其从当前的黑光更改为更柔和的颜色。
感谢这里的任何帮助
I would like to change it from the current black light to a softer color.Appreciate any help here
推荐答案
我认为没有办法改变导航颜色的边框颜色, UINavigationBar
的 tintColor
属性除外。
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
.
我建议您创建一个边框大小的UIView并将其放在导航栏下面/将其添加为 subView
。
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];
这篇关于如何更改导航栏下方的边框颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!