Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What is going on with this article?
@hanoopy

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

More than 5 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が実際の値になりました。

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

6
Help us understand the problem. What is going on with this article?
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
hanoopy
PHPプログラマー。 iPhone開発勉強中。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
6
Help us understand the problem. What is going on with this article?