Work on converting an iOS6 application to iOS7, and they use this to customize a grouped table style.
cell.backgroundView = aView;
cell.selectedBackgroundView = bView;
When the application loads, it loads the backgroundView correctly, but when I click on the cell, selectedBackgroundView no longer works in iOS7. A click selects a cell so that it works, but selectBackgroundView just does not appear.
Any suggestions? The only thing I can think of is not to use selectedBackgroundView and just add and remove subviews to the cell every time they are selected and not selected.
/// UPDATE ///
Put this in my cellForRowAtIndex and still do NOT .
UIView *bgColorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
bgColorView.backgroundColor = [UIColor colorWithRed:(76.0/255.0) green:(161.0/255.0) blue:(255.0/255.0) alpha:1.0];
bgColorView.layer.masksToBounds = YES;
cell.selectedBackgroundView = bgColorView;
//// UPDATE 2 ///////////
If I put this in my cellforRowAtIndex
cell.selectedBackgroundView = nil;
cell.backgroundView = nil;
UIView *bgColorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
bgColorView.backgroundColor = [UIColor colorWithRed:(76.0/255.0) green:(161.0/255.0) blue:(255.0/255.0) alpha:1.0];
bgColorView.layer.masksToBounds = YES;
cell.selectedBackgroundView = bgColorView;
UIView *bgSColorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
bgSColorView.backgroundColor = [UIColor colorWithRed:(106.0/255.0) green:(201.0/255.0) blue:(255.0/255.0) alpha:1.0];
bgSColorView.layer.masksToBounds = YES;
cell.backgroundView = bgSColorView;
show cell.background bgSColorView, , ( BackgroundView ? BackgroundView ?
///UPDATE 3////
setSelectin: animation: ( ).
UIView *bgColorView = [[UIView alloc] init];
bgColorView.backgroundColor = [UIColor colorWithRed:(76.0/255.0) green:(161.0/255.0) blue:(255.0/255.0) alpha:1.0];
bgColorView.layer.masksToBounds = YES;
self.selectedBackgroundView = bgColorView;
UIView *bgSColorView = [[UIView alloc] init];
bgSColorView.backgroundColor = [UIColor colorWithRed:(106.0/255.0) green:(201.0/255.0) blue:(25.0/255.0) alpha:1.0];
bgSColorView.layer.masksToBounds = YES;
self.backgroundView = bgSColorView;
[super setSelected:selected animated:animated];
, . BOOOM, selectionBackgroundView , .