Centering subview's X in autolayout throws “not prepared for the constraint”

前端 未结 8 1271
予麋鹿
予麋鹿 2020-11-30 02:09

I have a custom UIView subclass which is being initialized via a nib.

In -awakeFromNib, I\'m creating a subview and attempting to center it in its super

8条回答
  •  甜味超标
    2020-11-30 02:48

    For others who come here: I got this error, because I added the constraints before I added the subviews to the hierarchy.

提交回复
热议问题