gpt4 book ai didi

iOS 9 约束小于或等于 X && 大于或等于 Y

转载 作者:行者123 更新时间:2023-11-29 01:06:29 26 4
gpt4 key购买 nike

是否可以将约束设置为...例如:

小于或等于 100 但大于或等于 50

这样一来,在较小的设备上(我很难让 iPhone 3.5 英寸到 4.7 英寸的 View 看起来不错,因为它们都属于同一尺寸等级)我的 View 会缩小,但只会缩小到某个点所以它们仍然可读?

最佳答案

是的。你需要这样的东西:

let constraint1 = NSLayoutConstraint(item: i, attribute: .Height, relatedBy: .GreaterThanOrEqual, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 100)
let constraint2 = NSLayoutConstraint(item: i, attribute: .Height, relatedBy: .LessThanOrEqual, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 200)

然后将两个约束添加到适当的 View 。

关于iOS 9 约束小于或等于 X && 大于或等于 Y,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36310636/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com