gpt4 book ai didi

ios - 按下 UIAlertViewController 行时更改背景颜色

转载 作者:搜寻专家 更新时间:2023-11-01 06:52:20 27 4
gpt4 key购买 nike

当用户按住 UIAlertController 行时,它在 iPad 上自然会变成灰色,但我想把它变成另一种颜色。我该怎么做?

let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.default, handler: { action in

}))
alert.addAction(UIAlertAction(title: "Settings", style: UIAlertAction.Style.default, handler: { action in
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, completionHandler: nil)
}))
self.present(alert, animated: true, completion: nil)

这就是当您按住一行时 iPhone 所做的。我想改变那个背景颜色。 This is what the iPhone does when you hold down a row. I want to change that background color.

最佳答案

你不能。

Important

The UIAlertController class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

来源:https://developer.apple.com/documentation/uikit/uialertcontroller

关于ios - 按下 UIAlertViewController 行时更改背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56342623/

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