【问题标题】:UIBarButtonItem tintColor issue while setting bold text on in accessibility在可访问性中设置粗体文本时出现 UIBarButtonItem tintColor 问题
【发布时间】:2019-04-15 02:02:18
【问题描述】:

在 Settings -> Display & Brightness -> Bold Text 中设置 Bold Text On 后,UIBarButtonItem tintColor 没有改变。 我在 iOS 11 和 12 中都面临这个问题。以前的版本没有检查过。

苹果开发者论坛已经提出了同样的问题,但我没有找到任何答案。

https://forums.developer.apple.com/thread/89337

如果有人对此有任何解决方法,请建议我。

【问题讨论】:

  • 您是否尝试过以编程方式进行操作?
  • 是的,我正在以编程方式设置 tintColor,并且在禁用粗体文本时它可以正常工作
  • 你能告诉我们你的代码吗??
  • btn.tintColor = [UIColor whiteColor];

标签: ios uinavigationbar uibarbuttonitem


【解决方案1】:

您可以尝试使用NSAttributedString 以编程方式进行,我从未通过情节提要完成它,但以编程方式使用[NSAttributedString.Key.font: .systemFontOfSize(size: 25), NSAttributedString.Key.foregroundColor: .blue] 的数组等,就像一个魅力。

【讨论】:

  • 实际上我在 UIBarButtonItem 中有图像。这就是为什么我需要设置 tintColor
【解决方案2】:

对我有用的一种方法是更改​​情节提要上的 Global Tint 选项,当然这不是完美的解决方案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-25
    • 1970-01-01
    • 2011-03-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多