ios - How to disable one specific constraint for a size class? -


say have view width 1/2 of superview in portrait, , 1/3 of superview in landscape, thought set different multipliers constraint, size class doesn't have feature.

then found solution in following post, says have disable , enable constraints different size classes.

changing multiplier of constraint based on size class

i don't know how it. find way of clearing constraints. don't want rebuild constraints again. want change 1 constraint. if delete constraint in current size class, deleted in other size classes. there way can disable constraint 1 specific size class?

use isactive property.

as documentation says

the active state of constraint. can activate or deactivate constraint changing property. note active constraints affect calculated layout. if try activate constraint items have no common ancestor, exception thrown. newly created constraints, active property no default. activating or deactivating constraint calls addconstraint: , removeconstraint: on view closest common ancestor of items managed constraint. use property instead of calling addconstraint: or removeconstraint: directly


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -