Xcode 4.5 新模拟器无法正确显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12512057/
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
Xcode 4.5 New Simulator not displaying properly
提问by AdamM
I have just finished installed xCode 4.5 and have been trying to understand the new simulator. I want to test my app in the old screen size and new screen size. However when under the simulator I go to hardware and change the phone size to the 4 inch size, it changes the simulator to take up the full screen, has no home button, is zoomed in, and I have to scroll to navigate which is really frustrating and annoying.
我刚刚安装了 xCode 4.5 并一直在尝试了解新的模拟器。我想在旧屏幕尺寸和新屏幕尺寸下测试我的应用程序。但是,当在模拟器下我转到硬件并将手机尺寸更改为 4 英寸尺寸时,它将模拟器更改为全屏,没有主页按钮,被放大,我必须滚动导航,这真的是令人沮丧和烦人。
From this
由此
To this
对此
Could someone tell me if this is meant to happen? I want to maintain the normal iPhone look with the simulator, that zoomed in scrollable simulator is terrible, looks horrible and makes debugging a pain. I am sure Apple would not allow something this poor looking to be the normal look for the simulator so I am guessing I am doing something wrong.
有人能告诉我这是不是注定要发生的吗?我想用模拟器保持正常的 iPhone 外观,放大的可滚动模拟器很糟糕,看起来很糟糕并且使调试变得痛苦。我确信 Apple 不会让这种看起来很糟糕的东西成为模拟器的正常外观,所以我猜我做错了什么。
The other problem with it is, if I am on the home screen where I can see a list of custom apps under normal iPhone screen size, then change it to the 4 inch simulator screen size, the custom apps I installed on the simulator are not showing for some reason.
另一个问题是,如果我在主屏幕上可以看到正常 iPhone 屏幕尺寸下的自定义应用程序列表,然后将其更改为 4 英寸模拟器屏幕尺寸,我在模拟器上安装的自定义应用程序不是出于某种原因显示。
Any help would be much appreciated!!
任何帮助将非常感激!!
Edit:
编辑:
I found I change the scale of the simulator under window and changing it to 50 or 75%. However one problem remains, why is there no home button in the iPhone 5 simulator?
我发现我在窗口下更改了模拟器的比例并将其更改为 50 或 75%。但是还有一个问题,为什么iPhone 5模拟器没有home键?
回答by Cal
What computer are you working on ? I've got a 13'' MacBook and the same thing occurred to me. Some topics say it is related to your screen resolution, and if your screen is "too small" then the simulator won't see the need in a frame representing the physical device. See Nathan Gopen's answer in XCode 4.3.1 iPad simulator. (I also noticed that the frame disappears when you re-scale standard iPhone to 75% or 50%.)
你在什么电脑上工作?我有一台 13 英寸的 MacBook,我也遇到了同样的事情。有些主题说它与您的屏幕分辨率有关,如果您的屏幕“太小”,那么模拟器将不会在代表物理设备的框架中看到需要。请参阅 Nathan Gopen 在XCode 4.3.1 iPad 模拟器中的回答。(我还注意到,当您将标准 iPhone 重新缩放到 75% 或 50% 时,框架会消失。)
If you need the home button you can find it in Hardware > Home Button, or Shift+Cmd+H. Yeah, I know, it sucks...
如果您需要主页按钮,您可以在硬件 > 主页按钮或 Shift+Cmd+H 中找到它。是的,我知道,这很糟糕……
回答by Yasser Amer
This Worked for me:
这对我有用:
- Go to Simulator Menu
- Go to Hardware
- Click Device
- Click IPhone
- 进入模拟器菜单
- 转到硬件
- 点击设备
- 点击 iPhone
This will restore the iPhone Simulator frame.
这将恢复 iPhone Simulator 框架。
回答by Ray Mckaig
What worked for me was...
对我有用的是...
- Go to XCode,
- Open the main XCode menu option
- Click on "Open Developer Tool"
- Click on "iOS Simulator"
- Change to the simulator you want by going to the "Hardware" menu.
- Close the simulator
- Run your project again.
- 转到 XCode,
- 打开主 XCode 菜单选项
- 点击“打开开发者工具”
- 点击“iOS模拟器”
- 通过转到“硬件”菜单更改为您想要的模拟器。
- 关闭模拟器
- 再次运行您的项目。
XCode was crashing on me when I switched to the non-retina iPad option and this was my solution.
当我切换到非视网膜 iPad 选项时,XCode 崩溃了,这是我的解决方案。
The simulator seems to remember the last hardware option that was chosen.
模拟器似乎记得最后选择的硬件选项。
回答by Trausti Thor
This just happened to me and I did spend a while trying to figure this one out. By setting the scale to 100% my issue got fixed as Cal said above.
这只是发生在我身上,我确实花了一段时间试图解决这个问题。通过将比例设置为 100%,我的问题得到了解决,正如 Cal 上面所说。
回答by Gerd
I don't think it's related to the screen resolution. I'm running it on 1920x1200 and it's the same. I guess it's simply to reduce effort for Apple since it's not essential for development to have a nice looking simulator. But yes, I agree I loved to see a virtual iPhone as simulator. And it was quite easier to produce screenshots of your Apps for your website.
我不认为这与屏幕分辨率有关。我在 1920x1200 上运行它,它是一样的。我想这只是为了减少 Apple 的工作量,因为拥有一个漂亮的模拟器对于开发来说并不是必不可少的。但是,是的,我同意我喜欢将虚拟 iPhone 视为模拟器。为您的网站生成应用程序的屏幕截图非常容易。
Zooming or scrolling is of course not required on a 1920x1200 screen.
在 1920x1200 屏幕上当然不需要缩放或滚动。
回答by jjk
I think this is related to retina display setting ...
我认为这与视网膜显示设置有关......
When I started the iOS simulator on my macbook pro (w/rd), the iPhone frame came up. I moved the frame over to my attached monitor and it stayed as an iPhone frame. I shut xCode down.
当我在我的 macbook pro(w/rd)上启动 iOS 模拟器时,iPhone 框架出现了。我将框架移到我连接的显示器上,它仍然是 iPhone 框架。我关闭了 xCode。
When I restarted, the iOS simulator started up on my attached monitor and lacked the phone frame, just showing the screen. Scaling up or down did not matter.
当我重新启动时,iOS 模拟器在我连接的显示器上启动并且缺少电话框架,只显示屏幕。放大或缩小并不重要。
I moved the unframed screen over to my laptop screen again, and shut down the simulator. When I started it back up, it started on the laptop screen with the phone frame.
我再次将无框屏幕移到我的笔记本电脑屏幕上,然后关闭模拟器。当我重新启动它时,它在带有手机框架的笔记本电脑屏幕上启动。
I don't think it is related to resolution so much as retina display.
我不认为它与视网膜显示的分辨率有关。
回答by Nabin
Not sure if this is long term solution, but the following steps helped me.
不确定这是否是长期解决方案,但以下步骤对我有所帮助。
- Go to Windows >> Scale
- Select different options as per your wish (I chose 75%)
- 转到 Windows >> 缩放
- 根据您的意愿选择不同的选项(我选择了 75%)