【问题标题】:How to set the titlecolor of a UIAlertAction in swift? [duplicate]如何快速设置 UIAlertAction 的标题颜色? [复制]
【发布时间】:2021-09-26 08:29:29
【问题描述】:

我想将 UIAlertAction 的文本颜色设置为红色。有谁知道这是怎么做到的吗?我很高兴收到您的来信。最好的问候

【问题讨论】:

  • 搜索UIAlertControllerNSAttributedString

标签: swift xcode swift5 ios14 xcode12


【解决方案1】:

你可以试试

cancelAction.setValue(yourColor, forKey: "titleTextColor")

其中yourColor 是您要设置的UIColor

【讨论】:

  • 有效!非常感谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-27
  • 2010-10-10
  • 1970-01-01
  • 2020-09-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多