简体   繁体   English

自动版式无法在iPhone 6s Plus中正常运行

[英]Autolayouts not working as expected in iPhone 6s Plus

I have 我有

  1. UIImageviewUIView - The Background image UIImageviewUIView-背景图像
  2. UIView - being treated as a gradient layer on top of the image. UIView-被视为图像顶部的渐变层。

Here the constraints given for the gradient view is 在这里,为梯度视图给出的约束是

  • Align top and leading to the UIImageView 对齐顶部并通往UIImageView
  • Equal height and Width as the UIImageView 高度和宽度等于UIImageView

These are working perfectly on iPhone 5s, 6s but fails to work on iPhone 6s Plus. 这些可以在iPhone 5s,6s上完美运行,但在iPhone 6s Plus上无法正常工作。 The gradient view doesnt cover the UIImageView fully. 渐变视图无法完全覆盖UIImageView。 Attaching a sample image 附加样本图像

在此处输入图片说明

PS I already unchecked Constraint to margin in Interface Builder. PS我已经在Interface Builder中取消选中Constraint to margin。 Still not working. 还是行不通。 Can anyone help me with what i am missing? 有人可以帮我解决我所缺少的吗?

Try these constraints on imageView and the other view on top of it: 在imageView及其上的另一个视图上尝试这些约束:

在此处输入图片说明

After loads of trial and error. 经过反复试验。 I finally found the solution. 我终于找到了解决方案。

  • Removed Equal height and Width as the UIImageView 删除了等于高度和宽度的UIImageView
  • Align bottom and trailing to the UIImageView 对齐底部并尾随UIImageView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM