我怎样才能获得“哑光”效果? UINavigationBar 上的颜色?

发布于 2024-11-30 19:14:51 字数 146 浏览 2 评论 0原文

如何在 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小清晰的声音 2024-12-07 19:14:51

没有内置的方法可以做到这一点。使用 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.

醉梦枕江山 2024-12-07 19:14:51

我使用类别 UINavigationBar 的简单方法:

@implementation UINavigationBar (UINavigationBarWithoutShiny)
- (void)drawRect:(CGRect)rect {}
@end

此后我可以仅使用 UINavigationBar 视图的背景颜色:

self.navigationController.navigationBar.backgroundColor = [UIColor greenColor];

My simple way using category UINavigationBar:

@implementation UINavigationBar (UINavigationBarWithoutShiny)
- (void)drawRect:(CGRect)rect {}
@end

after this i can use just background color of UINavigationBar view:

self.navigationController.navigationBar.backgroundColor = [UIColor greenColor];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文