xcode iphone 模拟器视图小于故事板

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13951258/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:21:41  来源:igfitidea点击:

xcode iphone simulator view smaller than storyboard

iphonexcodesizestoryboardsimulator

提问by GrymHyman

I'm having issues with the size of my story board and the size of the actual display on the iPhone Simulator. Any ideas?

我的故事板的大小和 iPhone 模拟器上实际显示的大小有问题。有任何想法吗?

screen shot

截屏

采纳答案by Niru Mukund Shah

Your simulator is proper. No need to resize it.

你的模拟器是正确的。无需调整大小。

You only need to follow these steps

您只需要按照以下步骤操作

 1. go to nib/storyboard.
 2. click on view
 3. check menu on right side
 4. go to 4th tab
 5. Expand Simulated Metrics
 6. Check Status bar is equal to Default
 7. Top Bar & Bottom Bar are equal to None & None respectively.

Enjoy Programming!

享受编程!

回答by Ramy Al Zuhouri

There are many correct answers to this question, but the thing is that you can do that by pressing a single button. I had the same problem and this is how I managed to solve it:

这个问题有很多正确答案,但问题是你可以通过按一个按钮来做到这一点。我遇到了同样的问题,这就是我设法解决它的方法:

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by a1phanumeric

The problem is that your storyboard is using the iPhone 5 screen size. To change your simulator to use the iPhone 5 emulator, goto the simulator and click on Hardware > Device > iPhone (Retina 4 inch).

问题是您的故事板使用的是 iPhone 5 屏幕尺寸。要将模拟器更改为使用 iPhone 5 模拟器,请转到模拟器并单击硬件 > 设备 > iPhone(Retina 4 英寸)。

回答by Pranjal Bikash Das

Your storyboard view is for iPhone 5 but your simulator is iPhone classic. Try changing the simulator to iPhone 5. And if you want to work this view for iPhone classic then try changing the autoresizing for the the two buttons.

您的故事板视图适用于 iPhone 5,但您的模拟器是 iPhone 经典版。尝试将模拟器更改为 iPhone 5。如果您想为 iPhone classic 使用此视图,请尝试更改两个按钮的自动调整大小。

回答by freelancer

Uncheck use Autolayoutfrom file inspector

从文件检查器中取消选中使用自动布局

1. go to nib.

1.去笔尖。

2. click on view

2.点击查看

3. go to 1st tab

3.转到第一个标签

4. Uncheck use Autolayout

4.取消选中使用自动布局

回答by GrymHyman

Figured out the answer on how to keep the display at the regular size without having to add and then remove the bars for every screen. I will have to steal part of an earlier answer:

找出有关如何将显示保持在常规尺寸而无需为每个屏幕添加然后删除条的答案。我将不得不窃取早期答案的一部分:

  1. go to nib/storyboard.
  2. click on view
  3. check menu on right side
  4. go to 4th tab
  5. Expand Simulated Metrics
  6. Change the 'size' value to 'Retina 3.5 Full Screen'.
  1. 转到笔尖/故事板。
  2. 点击查看
  3. 检查右侧的菜单
  4. 转到第 4 个标签
  5. 扩展模拟指标
  6. 将“大小”值更改为“Retina 3.5 全屏”。

That makes the storyboard layout the same size as the IPhone simulator.

这使得故事板布局与 iPhone 模拟器的大小相同。

回答by anxiety

For me, Xcode seemed to fire up the iOS Simulator viewing the iPhone 4 model by default. Maybe there's a better way to set this within Xcode, but in the iOS Simulator app you can go to Hardware > Device and select the screen size you want.

对我来说,Xcode 似乎默认启动了 iOS 模拟器查看 iPhone 4 模型。也许有更好的方法在 Xcode 中进行设置,但在 iOS Simulator 应用程序中,您可以转到硬件 > 设备并选择您想要的屏幕尺寸。