5

I would like to create rounded cells for my UITableView. But not for each cell, only the first and the last row (as shown in my screen)

enter image description here

The first is not a problem, i am only using:

tableView.layer.cornerRadius = 10

But what is with the last one? Any ideas how to solve that? Thanks in advance.

derdida
  • 14,784
  • 16
  • 90
  • 139
  • Create three different types cell, for the first cell, for the last cell and all other middle ones. For the first type make upper corner rounded. For the last cell type, make lower corner rounded and for all other leave as it is. And that should do it. – Sandeep Oct 09 '14 at 20:42
  • Thanks. Found already a good solution here: http://stackoverflow.com/questions/19176179/workaround-for-rounded-corners-of-grouped-uitableview-ios7 – derdida Oct 09 '14 at 21:08

1 Answers1

4

You use this code aftertableView.layer.cornerRadius = 10

tableView.layer.masksToBounds = true

I hope I have answered your question.

JGV
  • 5,037
  • 9
  • 50
  • 94
Ujjwal-Nadhani
  • 613
  • 2
  • 9
  • 20