简体   繁体   English

iOS Development Simulator视图被压缩

[英]iOS Development Simulator view squashed

I have just started iOS programming and am following a tutorial on iTunesU from Stanford. 我刚刚开始iOS编程,并且正在关注斯坦福大学关于iTunesU的教程。

In the first tutorial we were shown how to build a simple RPN calculator. 在第一个教程中,我们向您展示了如何构建一个简单的RPN计算器。 When I built and compiled in the simulator launched as normal but everything was "squashed". 当我在模拟器中构建和编译时,正常启动了模拟器,但一切都“被挤压”了。 I figured this was because the View in XCode is bigger than the iOS simulator. 我认为这是因为XCode中的View大于iOS模拟器。 How can I resize the view in Xcode or am I missing something. 如何在Xcode中调整视图的大小,或者我缺少某些内容。 Here is the iOS simuator view compared with the one from xcode 这是iOS模拟器视图与xcode中的视图相比 在此处输入图片说明

在此处输入图片说明

Looks like your view in Xcode's Interface Builder is a 4" view, and the simulator is running a 3.5" device. 看起来您在Xcode的Interface Builder中的视图是4“视图,而模拟器正在运行3.5”设备。 You can change either one. 您可以更改任何一个。

The view size in Xcode is changeable by selecting the entire view, and in the attributes inspector, you can change the size between Freeform, 3.5, 4. 通过选择整个视图,可以更改Xcode中的视图大小,并且在属性检查器中,可以在Freeform,3.5、4之间更改大小。

You can change the device in the simulator by going to Hardware>Device> Select your device 您可以通过以下方法在模拟器中更改设备:“硬件”>“设备”>“选择您的设备”

However, the overlapping buttons, etc, are more related to using Auto Layout, or misused struts. 但是,重叠的按钮等与使用“自动布局”或滥用的支撑杆更为相关。 You can either turn off Auto Layout and use struts, or take the challenge to learn Auto Layout. 您可以关闭自动版式并使用strut,也可以挑战学习自动版式。 Here's a start for Auto Layout: What is Auto Layout? 是自动版式的开始: 什么是自动版式?

It's not 'squashed' you are using the device simulator for the latest iPhone, which has a 4 inch display instead of 3.5 inch. 您正在使用最新的iPhone的设备模拟器,这不是“压扁”,它具有4英寸显示屏而不是3.5英寸显示屏。 To change device go to Hardware->Device in the simulator bar. 要更改设备,请转到模拟器栏中的“硬件”->“设备”。 And the iPhone frame does not show in the latest version of the simulator so to press the home button you go under Hardware->Home. 而且iPhone框架没有显示在最新版本的模拟器中,因此要按“主页”按钮,请进入“硬件”->“主页”下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM