How do I set UITableViewCellSelectionStyle property to some custom color?

前端 未结 9 1768
栀梦
栀梦 2020-12-13 04:04

I am developing an iPhone application, in my table view I wanted custom color for Cell Selection Style, I read the UITableViewCell Class Reference but there are onl

9条回答
  •  悲哀的现实
    2020-12-13 04:53

    - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {  
    // Set Highlighted Color  
    if (highlighted) {  
    self.backgroundColor = [UIColor colorWithRed:234.0f/255 green:202.0f/255 blue:255.0f/255 alpha:1.0f];
        } else {  
            self.backgroundColor = [UIColor clearColor];  
      }   
    }
    

提交回复
热议问题