5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TableHeaderViewの高さ変更は簡単じゃない!?!?

Last updated at Posted at 2016-07-26

UITableView.tableHeaderViewの高さを変更する

hoge.swift
tableView.tableHeaderView.frame.size.height = 0

では、ダメ

hoge.swift
if let tableHeaderView = tableView.tableHeaderView {
    var frame = tableView.frame
    // 新しいサイズを指定する(今回は高さなし)
    frame.size.height = 0
    tableHeaderView.frame = frame
    tableView.tableHeaderView = tableHeaderView
}

こんな感じにすることでいけました。

5
3
2

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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?