ios - 为新的表格 View 单元格设置暂停动画

标签 ios swift animation tableview cell

我试图显示新的表格 View 单元格,每个单元格之间出现短暂的暂停,以便用户可以清楚地看到新行已添加到现有的表格 View 中。我已尝试使用不同的动画时间的下面的代码,但它不起作用。

self.tableView.reloadData()

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
        UIView.animate(withDuration: 24.8, animations: {
        cell.contentView.alpha = 24.0
        }
    }

最佳答案

试试这个:

UIView.animate(withDuration: 0.3,
                           delay: 0.5,
                           options: .curveEaseInOut,
                           animations: {
                //Animation code.....
},
                           completion: nil)

关于ios - 为新的表格 View 单元格设置暂停动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46333291/

相关文章:

iOS-Charts 分组条形图,大小适合

ios - Xcode AMSlideMenu 在某些屏幕中禁用菜单

ios - 如何在 NSURL 检索 URL 的 html 时输出加载消息?

swift - 让标签在 Swift 中延迟出现

ios - 如何在 Swift 中向 Collection View Cell 添加删除按钮?

ios - 通过委托(delegate)将数据传递给各种 View Controller

ios - 防止 UITableViewCell ImageView 在点击时改变大小

javascript - 从左边开始一个一个地动画化列表项

css - 将背景颜色动画为不同的颜色

Android, hive 动画("Animators may only be run on Looper threads")错误