How could I add a shadow to a grouped UITableView (as seen in the official twitter app)?

前端 未结 5 773
攒了一身酷
攒了一身酷 2021-01-30 17:27

I have a standard grouped table view. I would like to add a shadow around it (i.e. around the edge of each tableview section) - if you are not sure what I mean, then see the off

5条回答
  •  耶瑟儿~
    2021-01-30 18:14

    Actually you could try to use a normal mode tableView (not grouped) and create 2 (or more) kind of cells with a specific identifier for each. One for the top one with top/left/right shadow, one for the last with left/right/bottom shadow, and one for the other cells with left/right shadow. In your tableView:cellForRowAtIndexPath: just check at which row you are (ex. indexPath.row == 0) and return the proper cell.

提交回复
热议问题