UITableViewCell with custom gradient background, with another gradient as highlight color

前端 未结 3 781
庸人自扰
庸人自扰 2020-12-08 06:29

I have a custom UITableViewCell with a custom layout. I wanted a gradient background, so in my UITableViewDelegate cellForRowAtIndexPath: method, I create a CAGradientLayer

3条回答
  •  温柔的废话
    2020-12-08 06:40

    I'm not sure about the first question but I think you can set the selectedBackgroundView property similarly to how you set the backgroundView property. The white space between cells is probably the separator. You can change that color like

    tableView.separatorColor = [UIColor redColor];
    

提交回复
热议问题