ios - Auto layout constraint breaks when resizing view dynamically (dragging motion) -


i have view sandwiched between 2 other views, , height of middle view can changed through pan gesture.

i'm using gesture recognizer location of touch , feeding value middle view's height constraint make dynamically resizable.

one issue when touch location goes beyond middle view's bounds , overlaps either top view or bottom view, warning:

unable simultaneously satisfy constraints ...

will attempt recover breaking constraint

this hasn't caused real issues in case might cause big problem, i'd know if

a) it's correct use height constraint dynamically change height b) there way avoid getting warning logged

thanks!

to answer question:

a) yes, correct way update height of view

b) yes, there way rid of warnings

since view gets negative values height constraints, add check height never set negative value it. then, won't have error log anymore.

not sure if supporting ios 7 also, if are, app crash because of layout errors.

so, suggestion add this, updating constraints:

[self.heightconstraint setconstant:max(0, value)]; 

good luck project!


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -