代码之家  ›  专栏  ›  技术社区  ›  kchromik

UIAlertView应突出显示不同的按钮

  •  0
  • kchromik  · 技术社区  · 9 年前

    我有一个 UIAlertView 这将突出显示“取消”按钮,但应突出显示另一个按钮。切换按钮不是一个选项。

    我就是这样初始化警报的:

    let downloadAlert = UIAlertView(title: NSLocalizedString("Title", comment: ""),
                    message: NSLocalizedString("Message", comment: ""),
                    delegate: self,
                    cancelButtonTitle: NSLocalizedString("Cancel", comment: ""),
                    otherButtonTitles: NSLocalizedString("Okay", comment: ""))
    

    这是它的样子: enter image description here 谢谢你的帮助。

    1 回复  |  直到 9 年前
        1
  •  1
  •   Community    7 年前

    看起来您不能简单地更改UIAlertView的样式。我认为你需要访问你想要从外部修改的按钮。因此,请参见以下内容 link .