xcode 故事板未在 xamarin ios 设计器中打开
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30812139/
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
storyboard not opening in xamarin ios designer
提问by ncruz
This is my first project with Xamarin.iOS and am getting familiarized with the IDE for iOS.
这是我使用 Xamarin.iOS 的第一个项目,并且正在熟悉适用于 iOS 的 IDE。
I created a simple Xamarin.iOS 'Single Page Application' project. I did not add any code - the project files are as they are when created from 'New Project'.
我创建了一个简单的 Xamarin.iOS 'Single Page Application' 项目。我没有添加任何代码 - 项目文件与从“新项目”创建时一样。
When opening the main storyboard file in Xamarin Studio, the spinner image just keeps spinning and hangs. When I try to close Studio, it also hangs. I have to kill the process in Activity Monitor.
在 Xamarin Studio 中打开主情节提要文件时,微调器图像只是不断旋转并挂起。当我尝试关闭 Studio 时,它也会挂起。我必须在活动监视器中终止该进程。
If I open the storyboard in 'Source Code Editor' or in Xcode Interface Builder, it opens fine.
如果我在“源代码编辑器”或 Xcode Interface Builder 中打开故事板,它会打开得很好。
I did some research and saw this discussion thread on the Xamarin forums: https://forums.xamarin.com/discussion/23566/ios-designer-bug-there-was-problem-rendering-this-document-not-opening-storyboard
我做了一些研究,并在 Xamarin 论坛上看到了这个讨论主题:https: //forums.xamarin.com/discussion/23566/ios-designer-bug-there-was-problem-rendering-this-document-not-opening-故事板
I tried the solution that was mentioned by user Krunoslavterle, by opening the
storyboard in code editor but it still does not open. Here's what he posted:
"I had the same issue, resolved by opening storyboard with TextEdit,
there I changed: version="3.0" to 2.0, save, refresh and try to open the
storyboard. Xamarin studio will throw an error ("The format of this
legacy storyboard file is not supported"), then click on ("Upgrade this
file to a supported format"). After that the storyboard can be opened."
我尝试了用户 Krunoslavterle 提到的解决方案,在代码编辑器中打开故事板,但它仍然没有打开。这是他发布的内容:
“我遇到了同样的问题,通过使用 TextEdit 打开故事板解决了,我将:version="3.0" 更改为 2.0,保存、刷新并尝试打开故事板。Xamarin Studio 将抛出错误(“The不支持此旧故事板文件的格式”),然后单击(“将此文件升级为支持的格式”)。之后即可打开故事板。”
I have checked memory usage to see if it doesn't have enough to open and render the storyboard and it has enough memory to spare.
我已经检查了内存使用情况,看看它是否没有足够的内存来打开和渲染故事板,并且它有足够的内存来备用。
I opened Console.app and saw .spin and .hang logs that I can provide but am not comfortable in posting them publicly as they probably have sensitive info.
我打开了 Console.app 并看到了我可以提供的 .spin 和 .hang 日志,但我不愿意公开发布它们,因为它们可能包含敏感信息。
My dev environment:
Macbook5,2 with Mac OS X Yosemite 10.10
MonoFramework-MDK-4.0.0.143.macos10.xamarin.x86.pkg
XamarinStudio-5.9.0.431-0.dmg
Xamarin.iOS: monotouch-8.10.0.267.pkg
Xcode 6.3.2
我的开发环境:
Macbook5,2 和 Mac OS X Yosemite 10.10
MonoFramework-MDK-4.0.0.143.macos10.xamarin.x86.pkg
XamarinStudio-5.9.0.431-0.dmg
Xamarin.iOS:monotouch-8.10.0.267.pkg
Xcode .2
回答by Andection
Try to update xamarin studio from beta channel. I had same problem and after updating xamarin studio from beta channel storyboard started to load.
尝试从 beta 频道更新 xamarin studio。我遇到了同样的问题,从 beta 频道故事板更新 xamarin studio 后开始加载。
This bug in bug tracker: https://bugzilla.xamarin.com/show_bug.cgi?id=34734.
错误跟踪器中的此错误:https: //bugzilla.xamarin.com/show_bug.cgi?id =34734。
Discussion in xamarin forum: https://forums.xamarin.com/discussion/54411/storyboard-does-not-open-on-ios-hello-tutorial
xamarin 论坛中的讨论:https://forums.xamarin.com/discussion/54411/storyboard-does-not-open-on-ios-hello-tutorial
回答by ncruz
Got it to open by adding more memory - went from 2GB to 4GB - and now it opens, but it takes 1-2 minutes. I recommend having at least 6GB and ideally 8-10GB.
通过添加更多内存来打开它 - 从 2GB 到 4GB - 现在它打开了,但需要 1-2 分钟。我建议至少有 6GB,最好是 8-10GB。
回答by Valynk
My best advice is to NEVER
use the IOS designer
. It's rubbish. Always use Xcode Interface Builder. The main reason is, you're guaranteed the storyboard will be valid with IOS. I once created an empty storyboard in IOS Designer and compared the XML it generated to an empty storyboard created in Xcode. It was totally different. The designer version was missing a hell of a lot of information. Since then I have never trusted the IOS designer. Not only that, but constraints are pain in the ass to use on the IOS designer, whereby, they're a lot easier in Xcode. I've also have storyboards render totally wrong in the IOS designer if the layout is particularly complex.
我最好的建议是NEVER
使用IOS designer
. 这是垃圾。始终使用 Xcode Interface Builder。主要原因是,您可以保证故事板对 IOS 有效。我曾经在 IOS 设计器中创建了一个空的故事板,并将它生成的 XML 与在 Xcode 中创建的空的故事板进行了比较。这是完全不同的。设计师版本缺少大量信息。从那以后我就再也不相信IOS设计师了。不仅如此,在 IOS 设计器上使用约束也很麻烦,因此,它们在 Xcode 中要容易得多。如果布局特别复杂,我也会让故事板在 IOS 设计器中呈现完全错误。