3

I'm trying to create a segue from my Root View Controller to a little static Table View Controller. It's supposed to have only six options (it's static), yet there seems to be more rows shown below the last item.

The table view content is set to "static cells" and I've created a show segue from one of my Root View Controller's Table View Cell's to this Table View Controller.

How can I get rid of the endless list of rows under the "Every Year" option?

enter image description here

EDIT:

This is different from Hide remove separator line if UITableViewCells are empty because it has a much more elegant solution - see below.

Community
  • 1
  • 1
Daniel
  • 3,758
  • 3
  • 22
  • 43

3 Answers3

2

Do following.

enter image description here

It will hide all blank rows from tableview.

Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98
2

put this in viewDidLoad method, it will hide the bank cells.

for swift 2: tableView.tableFooterView = UIView()

Mahendra
  • 8,448
  • 3
  • 33
  • 56
karthik
  • 621
  • 4
  • 14
1

You just need to set tableview's style "Grouped".

  • Select tableview in storyboard and go to Attribute Inspector.

  • From the Style option you need to select "Grouped" (By default "Plain" is selected)

enter image description here

This will hide endless list of rows.

Mahendra
  • 8,448
  • 3
  • 33
  • 56