【问题标题】:Error trying to set the constraints for a UIButton尝试为 UIButton 设置约束时出错
【发布时间】:2018-10-23 02:18:15
【问题描述】:

错误:

2018-05-13 01:32:25.577503-0400 LoginScreen[2606:70991] *** 由于未捕获的异常“NSGenericException”而终止应用程序,原因:“无法使用锚激活约束 <0x60000046acc0 password><0x60000046ad40 in>

标签: ios swift user-interface autolayout constraints


【解决方案1】:

首先,您应该将forgotPasswordButtonloginButton 作为subView 添加到您的view

view.addSubview(forgotPasswordButton)
view.addSubview(loginButton)

那么,constraints 应该可以工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多