ios - 为什么`NSLayoutConstraint.multiplier`是只读的?
问题描述
这个决定背后的理由是什么,他们为什么这样做?
constant
while 读写是怎么来的,whilemultiplier
不是呢?
解决方案
Updating the constant of a constraint can be done very efficiently and fast. Changing its multiplier on the other hand is much more complicated on the inside and basically produces the same amount of work than removing and adding a constraint.
The API reflects this complexity so that developers are aware that this is a more expensive operation.
Posted 20 hours ago by Frameworks Engineer https://developer.apple.com/forums/thread/655663
推荐阅读
- python - 我想做一个在python中旋转的栏
- python - 如何匹配文本和可选的重复标识符并将它们组合在一起?
- c - 在声明时将字符串文字分配给 char 数组与分配给 char 指针之间的区别?
- php - 为什么javascript代码在laravel刀片文件中不起作用
- r - h(simpleError(msg, call)) 中的错误:在选择“坐标”函数的方法时评估“obj”参数时出错
- c# - 从 MVC 项目中的另一个文件夹 asp.net webform 页面调用主控制器
- angular - 如何在 Angular NX 工作区中使用标签运行 nx e2e 测试?
- c - C close() : 无效参数
- docker - 如何使用配置文件更改 Nexus 中 Docker 私有存储库的绑定端口?
- python - 读取 CSV 文件并提取信息