4
6

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 3 years have passed since last update.

[iOS13] ステータスバー・ナビゲーションバーのサイズ取得方法

Last updated at Posted at 2020-01-09

[Swift] ステータスバー・ナビゲーションバーのサイズ取得方法

こちらの情報がさすがに古くなりましたので私の方で更新してみます。


// ステータスバーの高さを取得
 let statusBarHeight = UIApplication.shared.statusBarFrame.height
       
// ナビゲーションバーの高さを取得
let navBarHeight = self.navigationController?.navigationBar.frame.size.height

iPadのNavigationBarのheightが50pxに変更

iPad Navigation Bar and Toolbar Height Changes in iOS 12

iOS12 のどこかのタイミングからiPadのNavigationBarの高さが50px になっていたからです。
今まで44pxで記憶していましたのでテストでベタ打ちで44pxで打つと6pxがズレてしまいます。

iPad Navigation Bar height now 50
https://forums.developer.apple.com/thread/103659

4
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
4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?