【发布时间】:2020-01-10 20:03:12
【问题描述】:
我希望我的按钮在中心上方 200 处。我的代码错误:
docButton.centerYAnchor.constraint(equalTo: view.centerYAnchor + 200),
与
Binary operator '+' cannot be applied to operands of type 'NSLayoutYAxisAnchor' and 'Int'
如何将按钮设置为在中心上方一些位置?
另外,我想设置一个后退按钮。如何将按钮的约束设置为顶部安全区域下方 20 点和左侧安全区域右侧 20 点?
提前致谢。
【问题讨论】:
-
docButton.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: 200)
标签: ios swift xcode autolayout constraints