Add a child control on the cell, when we click or long press, if the child control has a background color, the background color will be gone, this time the product manager came to a meal godless,??。 Just think of the following diagram:
So if you want to do a long press or click on the background color is not rendered, very simple, in the custom cell when the time to write two methods:
-(void) setselected: (BOOL) selected animated: (bool) animated { [Super setselected:selected animated:animated]; [Self changcolor]; Configure The view for the selected state}-(void) sethighlighted: (BOOL) highlighted animated: (BOOL) animated{ [ Super sethighlighted:highlighted animated:animated]; [Self changcolor];} -(void) changcolor{ //This is where the child controls initialize what color to set. Self.label.backgroundColor = [Uicolor orangecolor]; Background color of other child controls}
Look at the effect:
Ios-tableviewcell the background color disappears when selected.