Building a titleView programmatically with constraints (or generally constructing a view with constraints)

后端 未结 6 1813
长情又很酷
长情又很酷 2021-02-03 20:44

I\'m trying to build a titleView with constraints that looks like this:

\"titleView\"

I know how I would do

6条回答
  •  感情败类
    2021-02-03 21:20

    You have to set the frame of titleView because you don't specify any constraints for its position in its superview. The Auto Layout system can only figure out the size of titleView for you from the constraints you specified and the intrinsic content size of its subviews.

提交回复
热议问题