13
6

More than 3 years have passed since last update.

Grouped UITableViewのヘッダーの高さを0にする

Last updated at Posted at 2015-10-16

Solution

ヘッダーの高さはheightForHeaderInSectionで指定すればいいのですが、ここで0を指定するとデフォルトの高さになってしまうので、代わりにCGFloat.leastNormalMagnitude を使います。


extension HogeViewController: UITableViewDelegate, UITableViewDataSource {
  func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
    CGFloat.leastNormalMagnitude
  }
}

参考

13
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
6