UIStackView
hide show animation is very different between ios versions. Here is a basic setup. I have a UIStackView
with three arranged subviews inside it. And UIScrollView
contains UIStcakView
. I use auto layout. The stack view code is this:
let stack = UIStackView(arrangedSubviews: [view1, view2, view3])
stack.translatesAutoresizingMaskIntoConstraints = false
stack.axis = .vertical
stack.distribution = .fill
stack.alignment = .fill
The code that makes animation is this:
isHidden.toggle()
UIView.animate(withDuration: 2) {
self.view3.isHidden = self.isHidden
}
When this runs on ios 10 simulator the animation is correct.
However in ios 13 the animation is not correct.
So is there a way to make this animation just like on ios10? Or should I use UITableView
instead of UIStackView
?