从通用应用程序转换为 iPhone?
我有一个一年前的 MonoTouch 项目,它是作为通用应用程序创建的(但仅像 iPhone 应用程序一样编程。以防万一......)当我将其上传到 iPad 上时,它显示在这个 iPhone 模拟器中。 我在 MonoDevelop 的 iPhone 应用程序设置中将目标从 Universal 更改为 iPhone/iPod 以实现此目的。这似乎不再起作用了。 现在,当我更新到最新版本的 iOS 和 MonoTouch 时,iPad 保持白色,没有任何显示。这是可追踪的,因为我在 AppDelegateiPad 中没有代码。
所以我当前的项目存在以下文件:
AppDelegateIPad.cs
AppDelegateIPhone.cs
MainWindowIPad.xib
MainWindowIPad.xib.designer.cs
MainWindowIPhone.xib
MainWindowIPhone.xib.designer.cs
Main.cs
MainWindowIPhone.xib 包含一个将与窗口一起添加的 NavigationController AppDelegateIPhone.cs 中的 .AddSubview
转换的最好、最简单的方法是什么项目到仅限 iPhone 的项目。那么它可以在 iPad 上的 iPhone 模拟器中运行吗?
提前致谢!
I have a MonoTouch project from a year ago which was created as a universal app (but only programmed like a iPhone app. Just in case...) When I uploaded it on an iPad it was shown in this iPhone simulator.
I changed the Target from Universal to iPhone/iPod in the IPhone Application Settings in MonoDevelop to achieve this. This seems not to work anymore.
Now, when I updated to the latest verion of iOS and MonoTouch the iPad stays white nothing is shown. Which is traceable because i have no code in the AppDelegateIPad.
So my current project exists of the files:
AppDelegateIPad.cs
AppDelegateIPhone.cs
MainWindowIPad.xib
MainWindowIPad.xib.designer.cs
MainWindowIPhone.xib
MainWindowIPhone.xib.designer.cs
Main.cs
MainWindowIPhone.xib contains a NavigationController which will be added with window.AddSubview in AppDelegateIPhone.cs
What is the best, easiest way to convert the project to a iPhone only project. So it runs in the iPhone simulator on iPad?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您仍然可以将其保留为通用应用程序并仅针对 iPhone 或 iPad。我也在做这个。
在 Monodevelop 中,转到项目设置 -> iPhone 应用程序
就这样了。
如果您确实想要转换它并删除 iPad 的代码,请按照上述步骤操作,然后开始删除所有与 iPad 相关的内容。
还有一点注意:您不应该再使用
window.AddSubview(rootController.View)
。而是使用 window.RootViewController = rootController;You can still keep it as a universal app and target iPhone or iPad only. I'm doing this too.
In Monodevelop go to Project Settings -> iPhone Application
That should be all.
If you really want to convert it and remove the code for iPad, follow the steps above, then start removing all iPad related stuff.
One more side note: you should not use
window.AddSubview(rootController.View)
anymore. Instead usewindow.RootViewController = rootController;