LoginSignup
13
13

More than 5 years have passed since last update.

[[UIScreen mainScreen] bounds]で正しいスクリーンサイズが取得できない

Last updated at Posted at 2014-04-12

iPhoneとiPad両方対応しようとしたときに発生しました。
4inch iPhone SimulatorでRunしても画面サイズが3.5inchになってしまい、[[UIScreen mainScreen] bounds]でも320×480が返って来てしまいます。

次のリンクによると、スクリーンサイズはlanunch imageに依存しているらしく、適切なサイズのlaunch imageを設定すると解決するそうです。

ios - UIScreen MainScreen Bounds returning wrong size - Stack Overflow

Apparently, iOS relies solely on the presence of a launch image in the resolution of an iPhone 5+ in order to let the app run in that resolution.

自分はiPad用のlaunch imageしかセットしておらず、iPhone用のものをセットしたところ直りました。

13
13
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
13
13