Where should I be setting autolayout constraints when creating views programmatically

后端 未结 8 766
不思量自难忘°
不思量自难忘° 2020-12-07 07:52

I see different examples where constraints are set. Some set them in viewDidLoad / loadView (after the subview was added). Others set them in the m

8条回答
  •  不知归路
    2020-12-07 08:22

    Do it in view did layout subviews method

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
    }
    

提交回复
热议问题