6
4

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.

[メモ] ステータスバーのサイズ

Posted at

メモ

書いた投稿せずに何ヶ月も置いていたので、記載内容の信憑性は定かではありませんが実機でテストした結果だったと思います。
ご参考程度にどうぞ。

確認用コード

CGRect statusBarViewRect = [[UIApplication sharedApplication] statusBarFrame];
NSLog(@"h:%f", statusBarViewRect.size.height);
NSLog(@"w:%f", statusBarViewRect.size.width);

iOS7(iPhone4Sで検出)

端末向き縦の場合
 h:20.000000
 w:320.000000

端末向き横の場合
 h:480.000000
 w:20.000000

iOS7では端末の向きに関わらず、端末ホームボタンが下向きにある状態で見た向きが縦であるため注意が必要。

iOS8(iPhone6で検出)

端末向き縦の場合
 h:20.000000
 w:375.000000

端末向き横の場合
 h:0
 w:0

iOS8、あるいはiPhone6では端末の向きが横の場合にステータスバーは表示されない。

6
4
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?