ios - 如何在 SnapKit 中按值增加视图高度?
问题描述
我想在 SnapKit 中将高度增加 100,但我不知道该怎么做。它应该是这样的,但它不起作用
mainView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.height.equalTo(otherView.snp.height + 100) // problem here
}
解决方案
您可以使用inset
或offset
:
make.height.equalTo(otherView.snp.height).offset(100)
推荐阅读
- python - Python CodeLab 关于异常的问题——尝试,除了 ValueError
- python - 如何在 Python Selenium 中获取 href 链接
- scala - 遍历数据框中的每一列并执行比较
- amazon-web-services - 如果我想托管国际 Web 应用程序,我应该选择哪个 AWS 区域?
- javascript - 背景图像未在 ReactJS 材质 UI 中显示
- vba - 如何编写一个 PowerPoint VBA 宏,将形状“堆叠”在彼此之上/相互接触?
- multithreading - 当在线程中调用 time.sleep 时,处理器内部会发生什么?
- python - 删除列表列表中的重复元素
- qt - QTableView - 如何了解在排序表中选择了哪些项目?
- python - 计算输入列表的模式