Xcode 中的 IOS-Simulator 不显示类似 iPhone 的窗口,而是显示常规窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20902266/
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
IOS-Simulator in Xcode does not show iPhone -like but regular window
提问by user3156814
It used to work properly, with 100% as well as 50%. Then I did not use the simulator for some time but only the console, having moved the simulator almost out of site. Now I need it but realize that instead of an iPhone surface just a regular window is shown, like in this thread:
它曾经正常工作,100% 和 50%。然后我有一段时间没有使用模拟器而只使用控制台,几乎将模拟器移出现场。现在我需要它,但意识到只显示一个普通窗口而不是 iPhone 表面,就像在这个线程中一样:
XCode iPhone simulator does not look like an iPhone
I read lots of proposal I found on the web to this problem and followed the advices. So I changed the size to 100%, tried different iPhone devices. And finally I deleted the Xcode application from the application folder and removed all remaining items by putting in the order
我阅读了很多我在网上找到的关于这个问题的建议并遵循了建议。所以我将大小更改为 100%,尝试了不同的 iPhone 设备。最后我从应用程序文件夹中删除了 Xcode 应用程序,并通过放入订单删除了所有剩余的项目
sudo /Library/uninstall-devtools --mode=all
须藤 /Library/uninstall-devtools --mode=all
into the terminal. I downloaded Xcode again.
进入终端。我再次下载了Xcode。
The problem is still there.
问题仍然存在。
The very strange thing about it: It did work properly when I installed Xcode for the first time, about 6 weeks ago.
关于它的非常奇怪的事情:大约 6 周前,当我第一次安装 Xcode 时,它确实正常工作。
回答by Mischa
As far as I know it depends on the deployment target whether the simulator shows the iPhone frame or not. I think if you set iOS 7 as the target you won't be able to see the iPhone image around your app screen. (For example, I have never seen an iPhone image in the simulator for a 4'' device.)
据我所知,模拟器是否显示 iPhone 框架取决于部署目标。我认为如果您将 iOS 7 设置为目标,您将无法在应用程序屏幕周围看到 iPhone 图像。(例如,我从未在模拟器中看到 4 英寸设备的 iPhone 图像。)
Try changing the deployment target and play around with different devices under Hardware / Device in the simulator.
尝试更改部署目标并在模拟器中的硬件/设备下使用不同的设备。
Edit:
编辑:
Here is a more detailed answer. It's one of the replies to the question that you linked.
这是更详细的答案。这是对您链接的问题的答复之一。
回答by Mega
You better select your simulator and set Hardware -> Device -> iPhone
你最好选择你的模拟器并设置硬件 -> 设备 -> iPhone
Note 1: If you want the simulator should looks like iPhone do not select the retina simulator.
注意 1:如果你想让模拟器看起来像 iPhone,不要选择视网膜模拟器。
Note 2: You must check the target version of you app in xcode it must be below 7.0
注意 2:您必须在 xcode 中检查您的应用程序的目标版本,它必须低于 7.0
Note 3: Keep the scale of simulator always 100%.
注 3:保持模拟器的比例始终为 100%。
回答by Linus
Are you sure the current project you're working on is an iOS and not an OS X project? You can verify this be looking at the project's folder. If the app ist for OS X, there is most likely a .xib file. If it's a iOS project, there should be a storyboard file.
您确定您正在处理的当前项目是 iOS 而不是 OS X 项目吗?您可以通过查看项目的文件夹来验证这一点。如果该应用程序适用于 OS X,则很可能有一个 .xib 文件。如果是iOS项目,应该有storyboard文件。
As the OS X apps use windows, like the one you described, this could be a hint.
由于 OS X 应用程序使用 Windows,就像您描述的那样,这可能是一个提示。
回答by user3156814
I have found the solution for the problem I had (and other users as well):
我找到了我遇到的问题的解决方案(以及其他用户):
At PREFERENCES / DOWNLOADS older versions of the iOS simulator are available. While at the moment the current version is 7.0 (beginning January 2014), versions 6.0 and 6.1 are being offered for download.
在 PREFERENCES / DOWNLOADS 可以使用旧版本的 iOS 模拟器。目前,当前版本是 7.0(从 2014 年 1 月开始),正在提供 6.0 和 6.1 版本供下载。
After downloading I could chose more devices than with version 7.0. Now also the non-Retina iPhone is available.
下载后,我可以选择比 7.0 版本更多的设备。现在也可以使用非 Retina iPhone。
As a result, the iPhone surface is being displayed when set to 100% (at WINDOW - SIZE).
因此,当设置为 100%(在 WINDOW - SIZE)时显示 iPhone 表面。
Thanks to everyone helping!
感谢大家的帮助!