0

使用 snapkit,我得到了下面的图像。文本视图正在弹出视图上方,“列表名称”弹出标题在文本视图上方 10 像素以上。怎么修?

在此处输入图像描述

代码

private func makePopUpTitle() {
        popUpTitle.text = "List Name"
        popUpView.addSubview(popUpTitle)

        popUpTitle.snp.makeConstraints { (make) -> Void in
            make.centerX.equalTo(popUpView)
            make.top.equalTo(popUpView).offset(20)
        }

    }

private func makeListNameTextView() {
        self.automaticallyAdjustsScrollViewInsets = false
        popUpView.addSubview(nameTextView)

        nameTextView.snp.makeConstraints { (make) -> Void in
            make.left.equalTo(popUpView).offset(20)
            make.right.greaterThanOrEqualTo(popUpView).offset(20)
            make.top.equalTo(popUpTitle.snp.bottom).offset(10)
            make.width.lessThanOrEqualTo(popUpView.snp.width)
            make.height.equalTo(35)
            make.centerY.equalTo(popUpView)
        }
    }
4

1 回答 1

-2

就像评论说的:

make.right.greaterThanOrEqualTo(popUpView).offset(-20)

于 2018-01-28T17:17:18.870 回答