5
当我用动画更改单元格高度(使用beginUpdates(),endUpdates())我有一个非常奇怪的动画为我的部分页脚:它正在移动到桌面的底部。UITableView页脚的动画问题执行“beginUpdates”“endUpdates”时的视图
这里是最简单的代码,我可以写
func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? {
return "footer"
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return cellHeight
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.beginUpdates()
cellHeight += 20;
tableView.endUpdates()
}
我怎么能避免这个问题的动画?
我想知道这个代码将如何甚至不工作。 'cellHeight + = 20'是什么意思? – 2014-10-08 10:02:50
它停留在底部还是只是暂时的状态? – Amandir 2014-10-10 14:17:47
看看这篇文章http://stackoverflow.com/questions/5740518/uitableview-footer-stop-from-floating-over-content – 2016-05-19 02:45:40