iOS 13:UITextField具有LeftView间距问题-Xcode 11 [英] iOS 13: UITextField with LeftView spacing issue - Xcode 11
问题描述
带有Xcode 10.0的iOS 12.0
iOS 12.0 with Xcode 10.0
带有Xcode 11.0的iOS 13.0
iOS 13.0 with Xcode 11.0
我已将带有图像和标签的自定义LeftView用于在UITextField中添加LeftView.我还设置了所有必需的约束,但是仍然面临着LeftView宽度间距的问题.在旧的Xcode和iOS上运行良好,但是在新的Xcode和iOS之后出现了问题.
I have taken custom LeftView with image and label for adding LeftView in UITextField. I have set all the needed constraints also but still I am facing issues of LeftView width spacing. In old Xcode and iOS it was working well but after new Xcode and iOS there is something wrong.
推荐答案
我通过添加约束解决了类似的问题. 确保已设置UIImageView和UILabel宽度限制以及其他视图的边距,例如:
I had similar problem fixed by adding constraints. Make sure had set UIImageView and UILabel width constraints and margins with other views, like:
H:|-0-[image(==40)]-0-[label(==70)]-0-|
希望获得帮助.
这篇关于iOS 13:UITextField具有LeftView间距问题-Xcode 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!