简体   繁体   English

在Xcode Interface Builder中为不同大小的类设置不同的乘数值?

[英]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|RegularRegular|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.

相关问题 Xcode 8:界面构建器显示设置的不同颜色 - Xcode 8: Interface builder shows different color that set Interface Builder和模拟器中的大小不同 - Different size in Interface Builder and simulator 使用乘数自动布局,在xcode 8的界面生成器中为不同的屏幕尺寸创建自动调整大小的视图 - creating auto resizeable views for different screen size in interface builder of xcode 8 using auto layout using multipliers 如何为不同大小的类设置不同的约束 - how to set a different constraint for different size classes 为不同的大小类设置不同的位置和约束 - set different position and constraints for different Size classes 为不同的大小类设置不同的约束 - Set different constraints for Different Size classes 如何在Xcode中的不同iPhone尺寸类中使用不同尺寸的图像 - How to use different size of image in different iPhone size classes in Xcode Xcode 6,Interface Builder大小问题 - Xcode 6, Interface Builder size issues 如何使用界面生成器为不同的设备设置不同的引导空间 - how to set different leading space for different devices using interface builder 模拟器中不同的视图大小,具体取决于在Interface Builder Xcode 9中选择的设备 - Different view sizes in simulator depending on chosen device in Interface Builder Xcode 9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM