How to set topLayoutGuide position for child view controller

后端 未结 4 1026
耶瑟儿~
耶瑟儿~ 2020-12-14 00:35

I\'m implementing a custom container which is pretty similar to UINavigationController except for it does not hold the whole controller stack. It has a UINavigationBar which

4条回答
  •  死守一世寂寞
    2020-12-14 01:25

    I think they mean you should constrain the layout guides using autolayout, i.e. an NSLayoutConstraint object, instead of manually setting the length property. The length property is made available for classes that choose not to use autolayout, but it seems with custom container view controllers you do not have this choice.

    I assume the best practice is make the priority of the constraint in the container view controller that "sets" the value of the length property to UILayoutPriorityRequired.

    I'm not sure what layout attribute you would bind, either NSLayoutAttributeHeight or NSLayoutAttributeBottom probably.

提交回复
热议问题