UiAlert多线问题在swift中

问题描述 投票:1回答:1

为什么文本在我的整个应用程序中以单行显示

let alert = UIAlertController(title: "PayPal", message: "With PayPal processing fee total amount is . Do you want to proceed?", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Yes", style: UIAlertActionStyle.default, handler: { (action: UIAlertAction!) in

}))
alert.addAction(UIAlertAction(title: "No", style: UIAlertActionStyle.default, handler: { (action: UIAlertAction!) in

}))
self.present(alert, animated: true, completion: nil)

enter image description here

ios swift uialertcontroller
1个回答
2
投票

很可能这个问题的原因是你在代码中覆盖了UILabel属性。当你删除该代码时,它肯定有效。

如果您不覆盖它,请在您的pod文件中搜索以下内容。可能是某些pod文件覆盖UILabel属性供其使用。

extension UILabel {
    ...
    override open func draw(_ rect: CGRect) { ... }
    override open var intrinsicContentSize: CGSize { ... }
    ...
}
© www.soinside.com 2019 - 2024. All rights reserved.