constraints - Xcode Auto Layout: Can't resize window -
what want achieve:
custom view 1 aligned @ top fixed height = 20px width = window width horizontal split view below custom view width = window width height = large possible custom view 2 aligned @ bottom fixed height = 20px width = window width
it's simple layout: header , footer @ top , bottom of window, , split view in between content left , right should resize window. however, apple designed auto layout manager poorly, can't seem work. (i've fumbled around 3 hours now!)
the problem is: give custom views fixed height, window height locked, can't resize vertically more. i'm trying following constraints:
custom view 1 constraints height = 20px custom view 2 height = 20px constraints leading horiz space custom view 1 superview = 0 leading horiz space custom view 2 superview = 0 leading horiz space split view superview = 0 trailing horiz space custom view 1 superview = 0 trailing horiz space custom view 2 superview = 0 trailing horiz space split view superview = 0 top vert space between custom view 1 , superview = 0 vert space between custom view 1 , split view = 0 vert space between custom view 2 , split view = 0 bottom vert space between custom view 2 , superview = 0 top vert space between custom view 2 , superview = 344px (!)
the last line added xcode, , can't delete it. of course, responsible fixed vertical layout. how can rid of it???
ok, figured out.
i had leave ib's redundant constraint in, give priority of 1. ib had given priority of 1000, overriding constraint.
Comments
Post a Comment