如何更改标题颜色? Swift 5

发布于 2025-01-29 01:53:02 字数 159 浏览 2 评论 0原文

我无法更改标题颜色,默认情况下是白色的,当我的背景颜色也是白色时,它是看不见的。如何将其更改为黑色? 在此处输入图像描述

I can't change title color, which is white by default and when my background color is white too, it's invisible. How can i change it to the black color?
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

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

评论(1

夏末 2025-02-05 01:53:02

尝试一下

self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.red]

Try this

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