我不能使用InterfaceBuilder在场景停靠子视图中添加约束。
我以编程方式尝试过,但是没有用。
func presentQuestionView3() {
questionHolder.addSubview(question3)
let q3height = question3.heightAnchor.constraint(equalTo: questionHolder.heightAnchor)
let q3width = question3.widthAnchor.constraint(equalTo: questionHolder.widthAnchor)
let q3centre = question3.centerXAnchor.constraint(equalTo: questionHolder.centerXAnchor)
NSLayoutConstraint.activate([q3height, q3width, q3centre])
}