ios - Keep expanded UITableViewCell fixed on top -
i have implemented skstableview , used command:
[tableview scrolltorowatindexpath:indexpath atscrollposition:uitableviewscrollpositiontop animated:yes];
when press cell expandable, , goes on top. i'd when scroll expanded cell went top stay fixed there until it's closed. can that?
in uitableview have uiscrollview methods. can this:
-(void)scrollviewdidscroll:(uiscrollview *)scrollview { uitableviewcell *cell =[self.mytableview cellforrowatindexpath:[nsindexpath indexpathforrow:0 insection:0]]; cgrect cellframe = [cell convertrect:cell.frame toview:self.view]; if (self.issticktotop) { self.cell.frame = cgrectmake(0, 0, self.cellframe.width, cellframe.size.height); } else { self.cell.frame = cgrectmake(0, scrollview.contentoffset.y, self.cellframe.width, cellframe.size.height); } }
the issticktotop
your maintenance bool
variable indicate if cell stick top or not. don't u don't know ;)
Comments
Post a Comment