您好,我有一个集合视图,该视图具有collectionview单元,其中的外部堆栈视图包含一个uibutton和一个内部的另一个堆栈视图。
当我单击单元格中的uibutton时,它是一个可折叠的集合视图,它必须隐藏带有动画的内部堆栈视图。怎么做
Collection view cell
Content view
Stack view
Uibutton
Stack view
我想在选择UI按钮时用动画隐藏内部堆栈视图
Cell Code
func setupUI(_ hidden: Bool, filter: Filter) {
self.filter = filter
UIView.performWithoutAnimation {
expandableStackView.isHidden = hidden ? false : true
self.filterTitleButton.setTitle(filter.filterTitle, for: .normal)
}
}
在行的控制器单元中,我将调用此setUpUI函数
UIView.animate(withDuration: 3,
delay: 0.0,
usingSpringWithDamping: 0.9,
initialSpringVelocity: 1,
options: [],
animations: {
innerStackView.hidden = true
stackView.layoutIfNeeded()
},
completion: nil)