I have a very very simple stackView:
stackView.spacing = 10
stackView.axis = .horizontal
stackView.alignment = .center
stackView.distribution = .fill
view.addSubview(stackView)
stackView.snp.makeConstraints { (make) in
make.center.equalToSuperview()
}
Then I add three button to it:
stackView.addArrangedSubview(button1)
stackView.addArrangedSubview(button2)
stackView.addArrangedSubview(button3)
Things are great here.
I then hide the button1 and button 3, the stackView also layouts as expected.
But when I hide all subviews, then click the debug view hierarchy in the Xcode, the console start to spit out complaints.
I did not add any explicit constraints. There are constrains that are implicitly generated by UIStackView.
So anyone have any idea how to eliminate these autolayout warnings?