我怎样才能获得“哑光”效果? UINavigationBar 上的颜色?
如何在 UINavigationBar 上获得哑光颜色而不是闪亮的外观?
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
How can I get a matte color on a UINavigationBar instead of the shiny look?
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有内置的方法可以做到这一点。使用
tintColor
将始终为您带来默认的“闪亮”外观。另一种方法是使用此处描述的技术自己绘制条形,以获得您想要的外观。There's no built-in way to do this. Using
tintColor
will always get you the default "shiny" look. The alternative is to draw the bar yourself, using the technique described here, to get the look you want.我使用类别 UINavigationBar 的简单方法:
此后我可以仅使用 UINavigationBar 视图的背景颜色:
My simple way using category UINavigationBar:
after this i can use just background color of UINavigationBar view: