ios - Set a UIView width twice another view using autolayout -


in screen have 2 view horizontally near each other. want width of first view twice of width of second view.

i man example, if right view has width=200 second 1 show with=100.

as search , in auto-layout, has options alignments , spaces between views. has option defining such relationships too?

you can programmatically adding manual constraints work autolayout. i'm sure using interfacebuilder option.

uiview *firstview; uiview *secondview; [firstview addconstraint:[nslayoutconstraint constraintwithitem:secondview                                                       attribute:nslayoutattributewidth                                                       relatedby:nslayoutrelationequal                                                          toitem:firstview                                                         attribute:nslayoutattributewidth                                                        multiplier:2.0                                                          constant:0]]; 

note multiplier there 2.0 forces width double.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -