iOS Override Auto Layout for certain components/objects in a view -
i have view series of buttons underneath each other, when 1 of buttons gets selected need programatically add onother button @ top of other buttons , change height of buttons no space lost bottom of screen.
the problem need auto layout turned on view, because of can't resize, or change position of buttons.
my question how can 'overide' autolayout of objects in view (buttons) change layout when button selected.
thanks
autolayout capable of use case you're describing. height of views can compress make room 1 more button.
use - (void)setcontentcompressionresistancepriority:(uilayoutpriority)priority foraxis:(uilayoutconstraintaxis)axis
on each of buttons , set priority low number (i.e. <250). since have vertical row, axis uilayoutconstraintaxisvertical
.
you have call -setneedsupdateconstraints
on superview of buttons in order new constraints show up.
Comments
Post a Comment