从通用应用程序转换为 iPhone?

发布于 2024-12-21 14:23:25 字数 699 浏览 5 评论 0原文

我有一个一年前的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花心好男孩 2024-12-28 14:23:25

您仍然可以将其保留为通用应用程序并仅针对 iPhone 或 iPad。我也在做这个。
在 Monodevelop 中,转到项目设置 -> iPhone 应用程序

  • 在“设备”下拉列表中选择“iPhone”。
  • 在“iPhone 部署信息”部分中,您必须选择正确的主界面。选择您的 MainWindowIPhone.xib

就这样了。

如果您确实想要转换它并删除 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

  • In the "Devices" drop down select "iPhone".
  • In the section "iPhone Deployment Info" you will have to select the correct main interface. Pick your MainWindowIPhone.xib

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 use window.RootViewController = rootController;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文