iphone - Add a view to a UITableViewCell's contentView when it is selected -
i trying add new view 5 buttons cell once selected. trying in 3 different ways. first 1 checking if selected inside
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath
method.
if (cell == nil ) { //initial customizaton of cells } else { if ([cell isselected]) { //i add view cell's contentview here never enters if though cell still blue, scrolled table , forth several times , blue cell never evaluated here } }
i have tried inside following 2 methods:
- (nsindexpath *)tableview:(uitableview *)tableview willselectrowatindexpath:(nsindexpath *)indexpath
and:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath
i used tableview:cellforrowatindexpath:
reference cell , when had reference tried adding view inside cell's contentview didn't seem work(by "didn't work" mean didn't appear, i'll debug further).
i know didn't provide detailed code that's because want know what's general principle of how should done. want know why cell doesn't stay selected
property equal yes
though stays blue (when selectionstyle
default one) when tap it. want stay "blue"(selected) view inside until deselect , remove said view.
did try creating own custom uitableviewcell
? think point, can overload setselected:
method there.
Comments
Post a Comment