gpt4 book ai didi

ios - 更改 UIAlertController 背景色

转载 作者:可可西里 更新时间:2023-11-01 01:18:44 25 4
gpt4 key购买 nike

是的,我知道。您无法更改 UIAlertController 的外观。我不想更改 UIAlertController 本身的背景,我想更改 View 背景的色调。你知道它像透明的黑色吗?我想将该颜色更改为清除。我该怎么做?

最佳答案

对于 swift 3 UIAlertController 改变背景颜色。

let alert = UIAlertController(title: "validate",message: "Check the process", preferredStyle: .alert)
let dismissAction = UIAlertAction(title: "Dismiss", style: .destructive, handler: nil)
alert.addAction(dismissAction)
self.present(alert, animated: true, completion: nil)
// change the background color
let subview = (alert.view.subviews.first?.subviews.first?.subviews.first!)! as UIView
subview.layer.cornerRadius = 1
subview.backgroundColor = UIColor(red: (195/255.0), green: (68/255.0), blue: (122/255.0), alpha: 1.0)

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

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