所有警报对话框消息和textField都已更改为单行。请检查图像 [英] All the alert dialog message and textField have been changed to single line. Please checkout the image

查看:131
本文介绍了所有警报对话框消息和textField都已更改为单行。请检查图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前所有的对话框和textField都运行良好。但不是我不知道这些TextFields如何突然变为单行三联。 (就像这里的一些消息......)

Previously all the dialog and textField are working well. But not I do not know how these TextFields are suddenly changed to single line with triple. (Like some Message here...)

    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)


推荐答案

我有同样的问题,经过3天3夜后解决了。由于UIAlertViewController使用UILabel来显示消息,因此我坚定地在整个项目中搜索修改UILabel的内容。我意识到没有任何搜索结果包含一些在功能名称中肯定有标签关键字的pod。我决定从他们的存储库下载所有pod的源代码,并使用另一个简单的文本编辑器在其中递归搜索,瞧!有些人决定覆盖默认的UILabel类,而不是在它们的pod中继承它。罪魁祸首是

I had the same problem and solved it after 3 days and nights. Since the UIAlertViewController uses UILabel to show the message, I was firmly searching all over the project for something modifying the UILabel. I realized that no search result includes anything from some pods that definitely has "label" keywords in their function names and such. I decided to download the source codes for all of the pods from their repositories and searched recursively inside them with another simple text editor and voila! Some guy decided to override the default UILabel class instead of subclassing it in their pod. The culprit lines were


扩展UILabel {
...
覆盖open func draw(_ rect :CGRect){...}
覆盖open var intrinsicContentSize:CGSize {...}
...
}

当我搜索UILabel扩展时,在XCode中使用搜索功能时,这些没有显示在搜索结果中。因此,我建议您在项目中打开任何第三方框架的源代码,并在其中单独搜索。 UILabel课程中肯定会出现问题。

These did not show up in the search results by using the search function in XCode as I searched for UILabel extensions to begin with. So, I recommend you to open any 3rd party framework's source codes in your project and search inside them separately. There is most definitely something messing with the UILabel class.

这篇关于所有警报对话框消息和textField都已更改为单行。请检查图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆