ios - Autolayout Dumbness (Mine)? -


i'm using auto layout in 1 of projects , having trouble thought should trivial task.

as example, have 2 text boxes below each other. have created vertical spacing constraint between two, of 5 points.

i expect if move top text box (using setframe), constraint mean bottom 1 automatically move enforce constraint?

is thinking correct? or using auto layout in way not meant to. ie. have misunderstood purpose. or should moving top text box using different manner other setframe?

any input great. in advance :-)

ps. have played around using: settranslatesautoresizingmaskintoconstraints seems work. however, doesn't seem proper way this. initial thoughts auto layout supposed handle size/position relationships little code, in case, expect handled 0 code.

you can't use setframe that. auto-layout decides frame. if change after fact constraints aren't automatically updated.

you reference constraint decides y position (either when create programmatically or using iboutlet) of top box , change value. trigger update recompute position of , run layout again.

you changing value of constant property on nslayoutconstraint object.

reference docs here


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -