ios - What happens with constraints when a view is removed -
the question have simple couldn't find information in documentation.
what happens layout constraints when view removed view hierarchy (or moved view)?
for example, let's have container c subviews a , b. container c holds constraints. call [a removefromsuperview]. happens constraints a?
what happens if add a c again?
the constraints removed. if add again, have make new constraints it, or if save constraints before remove a, can add them back. when this, save constraints view called view1:
self.portraitconstraints = [nsmutablearray new]; (nslayoutconstraint *con in self.view.constraints) { if (con.firstitem == self.view1 || con.seconditem == self.view1) { [self.portraitconstraints addobject:con]; } }
Comments
Post a Comment