gpt4 book ai didi

ios - 在 UIAlertController 中更改标题颜色

转载 作者:可可西里 更新时间:2023-10-31 23:55:02 25 4
gpt4 key购买 nike

我有两个按钮,但我只想将其中一个变成红色。当我使用下面的功能时
它全部变为红色。我只想改变一个按钮的颜色。我该怎么做?

alertController.view.tintColor = UIColor.redColor()

最佳答案

    let alertController = UIAlertController(title: title, message: message, preferredStyle: .actionSheet)

alertController.setValue(NSAttributedString(string: title, attributes: [NSFontAttributeName : UIFont.appFont_OpenSans_Regular(fontSize: 15),NSForegroundColorAttributeName : BLACK_COLOR]), forKey: "attributedTitle")
alertController.setValue(NSAttributedString(string: message, attributes: [NSFontAttributeName : UIFont.appFont_OpenSans_Regular(fontSize: 13),NSForegroundColorAttributeName : APP_COLOR_BLUE_1]), forKey: "attributedMessage")

关于ios - 在 UIAlertController 中更改标题颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36662233/

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