我設置一個自定義的UITableViewCell選擇顏色如下:自定義的UITableViewCell,突出了色彩
cell.contentView.backgroundColor = [[UIColor alloc]initWithRed:250.0/255.0 green:250.0/255.0 blue:250.0/255.0 alpha:1];
UIView *bgColorView = [[UIView alloc] init];
bgColorView.backgroundColor = [UIColor colorWithRed:(240.0/255.0) green:(240.0/255.0) blue:(240.0/255.0) alpha:1.0];
bgColorView.layer.masksToBounds = YES;
cell.selectedBackgroundView = bgColorView;
這工作完全,只是因爲我的UITableViewCell的常規背景顏色不是白色,當亮點後淡出發生去白色,然後我的背景顏色,而不是退色到我的背景顏色。有人知道如何解決這個問題嗎?
向我們展示整個cellForRowAtIndexPath方法 – Vame