IOS grouped tableview transparent cells

前端 未结 3 537
花落未央
花落未央 2021-01-21 04:33

Trying to create a grouped tableview with trasnparent cells without any borders. Tableview\'s background color from top to bottom goes darker to lighter.

but somehow ta

3条回答
  •  长发绾君心
    2021-01-21 04:59

    Maybe you intentionally left this out but how are you getting your new cell are you dequeing it? is it a custom cell? assuming it is a standard cell I would try:

    [[cell imageView] setBackgroundColor:[UIColor clearColor]];
    

    and i would keep

    [cell setBackgroundColor:[UIColor clearColor]];
    

    Another idea is to set it to white and set the alpha to 0 so in the end it is clear, but that doesn't feel like the best solution.

    Maybe that would work? I didn't attempt to recreate the issue to test this solution. If it is a custom UITableViewCell then I would just set the properties in the xib.

提交回复
热议问题