代码之家  ›  专栏  ›  技术社区  ›  Meenakshi Borade

以编程方式操纵前导约束Swift 4[已关闭]

  •  -1
  • Meenakshi Borade  · 技术社区  · 6 年前

    如何在Swift 4中以编程方式查找UIView的前导约束,以及如何以编程方式操纵前导约束?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Shehata Gamal    6 年前

    你可以试试

     for con in otherView.constraints {
       if(con.firstAttribure == NSLayoutAttribute.leading) {
           /// here con is a leading constraint
        }
     }
    

    或者最好使用约束标识符快速找到它