[英]Set Different Multiplier Value for Different Size Classes in Xcode Interface Builder?
I have a UIImage
. 我有一个
UIImage
。 When this UIImage
appears on an iPhone I want the height of this UIImage
to be 0.5 of the height of the screen. 当这个
UIImage
出现在iPhone上时,我希望这个UIImage
的高度为屏幕高度的0.5。 When this UIImage
appears on an iPad, I want the hight of the UIImage
to be 0.3 of the height of the screen. 当这个
UIImage
出现在iPad上时,我希望UIImage
的高度为屏幕高度的0.3 UIImage
。
I have tried using Interface Builder Size Classes to set a different Multiplier
for Compact|Regular
and Regular|Regular
, but when I change the Multiplier
value, it changes across all Size Classes. 我已经尝试使用Interface Builder Size Classes为
Compact|Regular
和Regular|Regular
设置不同的Multiplier
,但是当我更改Multiplier
值时,它会在所有Size Classes中更改。
Is there a way to set a different Multiplier
value for different Size Classes? 有没有办法为不同的大小类设置不同的
Multiplier
数值?
Create two equal heights constraints set one with multiplier 0.5, the other with 0.3. 创建两个相等的高度约束,一个用乘数0.5设置,另一个用0.3。 Click on the 0.5 constraint, open the size inspector, unclick installed, click the plus next to the installed checkbox, select compact|regular/any.
单击0.5约束,打开大小检查器,取消安装,单击已安装复选框旁边的加号,选择compact | regular / any。 Do the same for the 0.3, but select regular|regular.
对0.3执行相同操作,但选择常规|常规。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.