gpt4 book ai didi

ios - 具有十六进制值的 NavigationBar 色调颜色在 iOS 中效果不佳

转载 作者:行者123 更新时间:2023-11-29 00:36:01 25 4
gpt4 key购买 nike

如果我在 NavigationBar 中设置了 UIColor.Red,那就完美了。

代码:

this.NavigationController.NavigationBar.BarTintColor = UIColor.Red;
this.NavigationController.NavigationBarHidden = false;

输出:

enter image description here

但是如果我设置 Hex color 它会显示一些其他颜色,这不是我想要的实际颜色

this.NavigationController.NavigationBar.BarTintColor = UIColor.Clear.FromHexString("#0072BA", 1.0f);
this.NavigationController.NavigationBarHidden = false;

输出:

enter image description here

实际输出颜色:

enter image description here

Note :

I also set color using FromRGB but that also display different color.

有没有我想念的属性,然后告诉我,因为我是 Xamarin 和 Ios 的新手。

感谢任何帮助。

简单问题:

InBuild 颜色有效,但为什么十六进制颜色代码无效。

最佳答案

您需要为 naviagtionbar 禁用此属性。

NavigationController.NavigationBar.Translucent = false;

关于ios - 具有十六进制值的 NavigationBar 色调颜色在 iOS 中效果不佳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40609050/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com