ios - UITableViewCell selection flickers on reload -
i have uitableview
have hooked nsfetchedresultscontroller
. when object updated, use reloadrowsatindexpaths
reload cell. want keep cell selected while reloaded. below code how reselecting cell after update. works, cell displays unselected half second before becoming selected again , looks bad. self.selectedindexpath
set in didselectrowatindexpath
.
i've tried setting cell selected , highlighted in cellforrowatindexpath
, did nothing.
does know how prevent flickering? i'm using ios 8.3 btw.
// called in controllerwillchangecontent [self.tableview beginupdates]; ... // called in didchangeobject [self.tableview reloadrowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationnone]; ... // called in controllerdidchangecontent [self.tableview endupdates]; if( self.selectedindexpath ) { [self.tableview selectrowatindexpath:self.selectedindexpath animated:no scrollposition:uitableviewscrollpositionnone]; }
Comments
Post a Comment