简体   繁体   English

如何为不同大小的类别设置子视图高度限制

[英]How to set subview height constraints for different size classes

This is how I have set subview height in regards to superview.I have set constraints for compact width and regular height class as View.height = 0.5xheight . 这就是我就View.height = 0.5xheight设置子视图高度的方式。我已经将compact widthregular height类的约束设置为View.height = 0.5xheight I want to set View.height = 0.25xheight for regular width and regular height class. 我想为regular widthregular height类设置View.height = 0.25xheight

在此处输入图片说明

So basically I want to change multiplier to 0.25 for regular width and regular height class. 所以基本上我想将regular widthregular height乘数更改为0.25。 But I did not find any option to do that. 但是我没有找到任何选择。 So how can I do this. 所以我该怎么做。

只需转到Main.Storyboard并选择尺寸类别,即可在此处View as: iPad Pro (wR hR)并调整子视图的尺寸并更新约束。

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

相关问题 为不同的大小类设置不同的位置和约束 - set different position and constraints for different Size classes 为不同的大小类设置不同的约束 - Set different constraints for Different Size classes 不同尺寸类别的不同约束 - Different Constraints for Different Size Classes 如何为不同大小的类设置不同的约束 - how to set a different constraint for different size classes 如果子视图的大小与其父视图相同,如何使用ctrl-drag在IB中设置约束? - How to set constraints in IB using ctrl-drag if the size of my subview is the same as its superview? 当所有按钮的大小不同时如何设置约束 - How to set constraints when all buttons are of different size 如何根据iPhone的尺寸在Splash中设置不同的约束? - How to set different constraints in a Splash depending on the iPhone size? UIStackView 和子视图大小类 - UIStackView and subview size classes 如果在项目中启用了大小类,则无法使用约束来计算行高? - Unable to calculate row height using constraints if size classes are enabled in project? 以编程方式创建用于不同尺寸类的具有不同常量的自动布局约束 - Programmatically create auto layout constraints with different constants for different size classes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM