When you customize the selected background color to the cell, the control that has the background color on the cell will be obscured as if it disappears, and can be resolved in the following way
The selected background color of the cell I defined is green
UIView *bgview = [[UIView alloc]initwithframe:programcell.bg_view.bounds]; Bgview.backgroundcolor = [Uicolor greencolor]; Cell.selectedbackgroundview = Bgview;
Unselected effects
Effect When selected
Use the following method to set the future
// implement the following two methods in a cell file // in the following two methods, set the label's background color -(void) setselected: (BOOL) selected animated: (bool) animated { [ Super setselected:selected animated:animated]; // Configure The View for the selected state = graybgcolor; } -(void) sethighlighted: (BOOL) highlighted animated: (BOOL) animated{ [Super sethighlighted: Highlighted animated:animated]; = graybgcolor; }
Resolves an issue where a control with a background color on the cell is obscured after setting Selectedbackgroundview