2016-12-01 1 views
0

J'ai besoin d'agrandir les cellules d'un UITableView, mais je vois un scintillement en faisant cela.Comment éviter le scintillement lors du rechargement des cellules de vue table extensibles?

J'ai cette implémentation:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 

    // Switch row state 
    expandedFlags[indexPath.row] = !expandedFlags[indexPath.row] 

    UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: {() -> Void in 
      tableView.beginUpdates() 
      tableView.reloadRows(at: [IndexPath(row: indexPath.row, section: 0)], with: UITableViewRowAnimation.automatic) 
      tableView.endUpdates() 
     }, completion: nil) 
} 

Est-il possible d'éviter la pichenette lors du rechargement des cellules? J'ai lu plusieurs articles mais je n'ai pas travaillé pour mon scénario.

Répondre

0
tableView.beginUpdates() 
.... 
tableView.endUpdates() 

a déjà sa propre animation UIView d'animation ce qui rend probablement le scintillement