Help us understand the problem. What is going on with this article?

iOSアプリで実際の描画サイズとself.view.frameの数値が違うとき、「Resize View from nib」にチェックを入れる

More than 3 years have passed since last update.

self.view.frameの幅:高さが、常に600:600になっていて困りました。
シミュレータがiPadでも5Sでも4Sでも6でも、常に600:600。
こうなると、画像の中心点xをself.view.frame.width / 2に置く、とかができません。

storyboardで設定したら直りました。

a8c456292cf0b6b24a51a9c0690803a8.png

Attributes inspector内、View Controllerのlayoutにある「Resize View from nib」チェックボックスにチェックを入れます。
すると、self.view.frameのwidthやheightが実際の値になりました。

自分で外したんだと思いますが。。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away