代码修改约束

            //修改当前View自身约束

            NSArray* constrains = self.View.constraints;

            for (NSLayoutConstraint* constraint in constrains) {

                if (constraint.firstAttribute == NSLayoutAttributeHeight) {

                    constraint.constant = 0.0;

                }

            }

            

           //遍历view约束   修改View约束

            NSArray* constrains2 = self.view.constraints;

            for (NSLayoutConstraint* constraint in constrains2) {

                if (constraint.secondItem == self.tableView) {

                    //据底部0

                    if (constraint.firstAttribute ==NSLayoutAttributeBottom) {

                        constraint.constant = 0.0;

                        

                    }

                }

            }

你可能感兴趣的:(IOS)