简体   繁体   English

在Xcode或Swift中更改iPhone尺寸之间的垂直空间常数

[英]Change vertical space constant between iPhone sizes in Xcode or in Swift

I have a text two text fields and a button, it looks great on the iPhone 4 and 5 but not on the 6 and 6 Plus, it stretches to much because the keeps the constant stays the same of course. 我有一个文本,两个文本字段和一个按钮,它在iPhone 4和5上看起来不错,但在6和6 Plus上却看不到,因为可以使常数保持不变,所以它可以扩展很多。

Is there a way to increase it on the 6 or 6 Plus and keep it the same on the 4 and 5. Im using a vertical stack view and the bottom constraint is linked to the top of the button underneath it. 有没有一种方法可以在6或6 Plus上增加它,并在4和5上保持相同。Im使用垂直堆栈视图,底部约束链接到其下方的按钮顶部。

This is okay 没关系啦 iPhone 4视图

This size I want to maintain 我要保持这个尺寸 iPhone 5视图

Still stretches 仍然舒展 iPhone 6视图

WHY!? 为什么!? iPhone 6 Plus视图

如果您想让子视图的高度与screenSize相同,则尝试为垂直的stackview赋予固定高度。

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

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