Я хочу увеличить высоту просмотра с помощью анимации в ячейке UITableView
.Это работает, но анимация не работает, как я хочу.Мой код что-то вроде.
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
let cell = listingTableView.dequeueReusableCell(withIdentifier: "listingTableViewCell", for: indexPath) as! listingTableViewCell
//Charactristic expand
let isExpand = isExpandViewArr[indexPath.row]
if isExpand == true {
cell.expandBtn.setImage(UIImage(named: "down-arrow"), for: .normal)
UIView.animate(withDuration: 0.5) {
cell.expandViewHeight.constant = 0
self.loadViewIfNeeded()
}
}else{
cell.expandBtn.setImage(UIImage(named: "up-arrow"), for: .normal)
UIView.animate(withDuration: 0.5) {
cell.expandViewHeight.constant = 40
self.loadViewIfNeeded()
}
}
}
Пожалуйста, проверьте экран по ссылке: https://ibb.co/XjjXRz5