Changing background color of selected cell?

后端 未结 30 2969
太阳男子
太阳男子 2020-11-29 00:22

Does anyone know how to change the background color of a cell using UITableViewCell, for each selected cell? I created this UITableViewCell inside the code for TableView.

30条回答
  •  猫巷女王i
    2020-11-29 00:53

    Works for me

    UIView *customColorView = [[UIView alloc] init];
        customColorView.backgroundColor = [UIColor colorWithRed:180/255.0 
                                                          green:138/255.0 
                                                           blue:171/255.0 
                                                          alpha:0.5];
        cell.selectedBackgroundView =  customColorView;
    

提交回复
热议问题