随着内部 UITextView 的增长,我想让 inputAccessoryView 可扩展。inputAccessoryView 有一个私有 NSLayoutConstraint,标识符为 '_UIKBAutolayoutHeightConstraint'
尽管通过了 inputAccessoryView.constraints 数组中的每个约束,但我无法访问。我尝试了两种方法:
var constraints:[NSLayoutConstraint] = tableView.inputAccessoryView!.constraints() as Array
for (c: NSLayoutConstraint) in constraints{
if c.identifier == "_UIKBAutolayoutHeightConstraint"{
println("height")
}
}
var constraints:[NSLayoutConstraint] = tableView.inputAccessoryView!.constraints() as Array
for (c: NSLayoutConstraint) in constraints{
if c.firstAttribute == NSLayoutAttribute.Height{
println("height constraint found")
}
}