ios - Xcode remove cell with animation programmatically -
hi have been searching around find way remove static cell animation have not found solution problem. have tried: [tableview deleterowsatindexpaths:[self.taskarray objectatindex:indexpath.row] withrowanimation:uitableviewrowanimationfade];
no success.
you need hide cell before shown, in uitableviewdelegate's tableview:willdisplaycell:forrowatindexpath:
method. last method in control can manipulate cell display. not remove space cell takes, thing can try set cell row's height 0 using tableview:heightforrowatindexpath:
method of same protocol.
- (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [super tableview:tableview cellforrowatindexpath:indexpath]; if (yourcell) { return 0; } else { return [super tableview:tableview heightforrowatindexpath:indexpath]; } }
Comments
Post a Comment