简体   繁体   English

为所有设备设置常量

[英]Set Constant for all Devices

I'm trying to set a constant between iPhone (4,5,6...) and iPad, but I can't do a difference between iPhone 4 and iPhone 6 for example, so how to do ? 我正在尝试在iPhone(4,5,6 ...)和iPad之间设置一个常数,但是例如,我无法在iPhone 4和iPhone 6之间进行区别,该怎么办?

在此处输入图片说明

this question has a script that i use for this purpose 这个问题有一个我为此目的使用的脚本

Detect current device with UI_USER_INTERFACE_IDIOM() in Swift 在Swift中使用UI_USER_INTERFACE_IDIOM()检测当前设备

use it, and define constraints constant according to the device, and that's it. 使用它,并根据设备定义约束常量,仅此而已。 :) :)

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

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