简体   繁体   中英

Set Different Multiplier Value for Different Size Classes in Xcode Interface Builder?

I have a 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. When this UIImage appears on an iPad, I want the hight of the UIImage to be 0.3 of the height of the screen.

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.

Is there a way to set a different Multiplier value for different Size Classes?

Create two equal heights constraints set one with multiplier 0.5, the other with 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. Do the same for the 0.3, but select regular|regular.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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