LoginSignup
4
3

More than 5 years have passed since last update.

TableViewで色々な設定

Posted at

1.UITableViewで表示するセルの数が少ない場合,余分な横線を削除する方法:

tableView.tableFooterView = UIView()

2.UITableViewで高さの設定

cellの高さの設定

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    return 68
}

sectionの高さの設定

func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
    return 68
}

UITableViewのCellの高さを自動調整してくれるUITableViewAutomaticDimension

    tableView.estimatedRowHeight = 68
    tableView.rowHeight = UITableViewAutomaticDimension
4
3
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
4
3