首页 > 解决方案 > 如何在 SnapKit 中按值增加视图高度?

问题描述

我想在 SnapKit 中将高度增加 100,但我不知道该怎么做。它应该是这样的,但它不起作用

mainView.snp.makeConstraints { make in
    make.center.equalToSuperview()
    make.height.equalTo(otherView.snp.height + 100) // problem here
}

标签: iosswiftsnapkit

解决方案


您可以使用insetoffset

make.height.equalTo(otherView.snp.height).offset(100)

推荐阅读