1
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.

画面回転やSplit View等により画面サイズが変更した場合にレイアウトを再計算したい

1
Posted at

縦と横向きでレイアウトを変えたい時や、レイアウトを微調整したい時に使えます。
画面回転時やSplit View時にはviewWillLayoutSubviews()が呼ばれるので、そこにレイアウトを調整する処理を記述しましょう。

swift
// レイアウト開始直前に呼ばれる
// 画面回転時やSplit View適用時
override func viewWillLayoutSubviews() {
    // レイアウト調整処理を記述する
    // 例えば、View.reloadData()
}
1
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
1
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?