追記: 2017/04/03
UITableViewにgroupedというタイプがあることを知りませんでした><
もしかしたらお探しの結果はTableViewをgroupedにすることで実現するかもしれません。
元記事も残しておきますが、かなりのチカラワザであることをご承知ください
元記事
空のUIViewかなんかをtableFooterViewに設定してあげると良いみたいです。
Before | After |
---|---|
Swift
view.backgroundColor = .groupTableViewBackground
let tableFooterView = UIView(frame: CGRect.zero)
tableView.tableFooterView = tableFooterView
もしうまくいかなかったら、最初の行の view
を tableView
に変えてみてください。
参考
UITableViewのPlainスタイルで空のセルを表示させないようにする
How to remove empty cells in UITableView? [duplicate]