简体   繁体   中英

Specifying constraints on Xcode

我想知道是否有任何方法可以在Xcode 接口构建器上为特定设备(iPhone 6,iPad Air等) 显式指定约束

Yes, you can assign constraint to particular device size, it's not a specific device like iPhone 5Se or iPhone 6 but is kind of specific size classes, like compact or regular.

Click on view as on the bottom left of storyboard and you will see different options of devices size, now on the bottom right of storyboard you can see vary for traits.

在此处输入图片说明

Now if you click height you can see devices which will effect and if you add any constraint or view here it will only affect these devices.

在此处输入图片说明

If you deselect height and select width, you will see different set of devices

在此处输入图片说明

You can use mix and match and set different constraints and can add different views for different size classes.

For more info on this please visit following links

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