Quando cambio un'altezza della cella con animazione (utilizzando beginUpdates(), endUpdates()) Sto avendo un'animazione molto strana per il mio footer della sezione: si sta muovendo in fondo alla tableview.problema di animazione con UITableView footer View quando si esegue "beginUpdates" "endUpdates"
Ecco il codice più semplice potrei scrivere
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()
}
Come potrei evitare questo problema animazione?
Mi chiedo come questo codice sarebbe nemmeno lavorare. Cosa intendi con 'cellHeight + = 20'? –
Rimane in fondo o è solo uno stato temporaneo? – Amandir
consulta questo post http://stackoverflow.com/questions/5740518/uitableview-footer-stop-from-floating-over-content –