ios - Xcode - Width and Horizontal Position Are Ambiguous -
i'm trying figure out how autolayout works , have run problem don't understand why getting warning "the width , horizontal position ambiguous" view. view bottom thin blue line can see in screenshot of viewcontroller dealing with:
the arrow , home buttons not have constraints. constraints larger gray view follows:
the constraints "authors" label follows:
and constraints blue thin view follows:
i don't understand why getting warning since larger gray view isn't getting warning there doesn't seem difference in how treat 2 views. made sure include constraints on leading , trailing space both of them why horizontal position ambiguous thin blue one? can kind of see why width might ambiguous don't understand why wouldn't ambiguous larger gray view. shouldn't autolayout automatically deal it? want width obvious scale screen size.
its better not put such view inside top bar, below greybar best if doing partition. have resolved way here.
for blue bar:
- you giving "bottom space to:", not necessary maintained "height equals:2"
- you giving "leading space to" , "align x" thats don't make sense.
solution:
just this->
- give "leading space to: superview(greyview)" , "trailing space to: superview(greyview)" both value 0
- give "top space to:(authors)" value
- and @ last "height equals to: 2" or wish.
constraints of greyview
constraints of label
constraints of blue bar
Comments
Post a Comment