iphone - How do I change the color of a UITableView row when it is selected? -
i've looked around answers have yet find 1 works. want able change background color, or image of uitableview row select.
i used transitioning views when select row, time want able change rows properties. know row want change, indexpath.row, don't know how go changing how row looks because cellforrowatindexpath method has been called!
what can change color?
you this:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ //first cell want change uitableviewcell* thecell = [tableview cellforrowatindexpath:indexpath]; //then change properties (label, text, color etc..) in case, background color thecell.contentview.backgroundcolor=[uicolor redcolor]; //deselect cell can see color change [tableview deselectrowatindexpath:indexpath animated:yes]; }
just make sure consider color change when recycle cells.
if need more info post comment.
Comments
Post a Comment