以前所有对话框和文本字段都运行良好。但不是我不知道这些文本字段如何突然变成单行三重。 (就像这里的一些消息......)
let alert = UIAlertController(title: "Cancel Booking !!", message: "Are you sure you want to cancel your booking?", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "No", style: .default, handler: nil))
alert.addAction(UIAlertAction(title: "Yes", style: .default, handler: self.cancelMessageDialog))
self.present(alert, animated: true, completion: nil)
我也遇到了同样的问题,三天三夜后解决了。由于 UIAlertViewController 使用 UILabel 来显示消息,因此我在整个项目中坚定地搜索修改 UILabel 的内容。我意识到搜索结果不包含某些 pod 中的任何内容,这些 pod 的函数名称等中肯定有“标签”关键字。我决定从存储库中下载所有 pod 的源代码,并使用另一个简单的文本编辑器在其中递归搜索,瞧!有些人决定覆盖默认的 UILabel 类,而不是在他们的 pod 中对其进行子类化。罪魁祸首是
extension UILabel {
...
override open func draw(_ rect: CGRect) { ... }
override open var intrinsicContentSize: CGSize { ... }
...
}
当我开始搜索 UILabel 扩展时,通过使用 XCode 中的搜索功能,这些并没有显示在搜索结果中。因此,我建议您打开项目中任何第三方框架的源代码并分别在其中进行搜索。 UILabel 类肯定有问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)