2016-12-01 1 views
0

拡大するにはUITableViewのセルが必要ですが、これを行うときにちらつきがあります。拡張可能なテーブルビューのセルを再読み込みするときのちらつきを避けるには?

私はこの実装を持っている:

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) 
} 

は、細胞を再ロードするときフリックを回避するための方法はありますか?私はいくつかの記事を読んだが、私のシナリオではうまくいきませんでした。

答えて

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

はおそらくすでにちらつきを作るもの、独自のアニメーションUIViewのアニメーションを持って

関連する問題