//遍历view约束,找到属于tableview的约束 NSArray* constrains = self.view.constraints; for (NSLayoutConstraint* constraint in constrains) { if (constraint.secondItem == self.tableView) { if (constraint.firstAttribute ==NSLayoutAttributeBottom) { constraint.constant = 0.0; } } }