如何制作MonoTouch跨平台

时间:2021-09-02 12:28:23

I am evaluating the technology our company will be using for Android and iOS development in the future.

我正在评估我们公司将来用于Android和iOS开发的技术。

As such I am looking into cross platform options as well as native development.

因此,我正在研究跨平台选项以及本机开发。

I understand that MonoTouch shares the same backend code, but the UI has to be duplicated.

我知道MonoTouch共享相同的后端代码,但UI必须重复。

I started my first MonoTouch project, and cannot understand how this would work. The project is in Visual Studio, and the MonoTouch for iOS has to run on mac. A VS solution wouldn't work on mac, so I was wondering how it looks on mac and how you share the code between the two?

我开始了我的第一个MonoTouch项目,但无法理解这是如何工作的。该项目在Visual Studio中,而MonoTouch for iOS必须在mac上运行。 VS解决方案无法在Mac上运行,所以我想知道它在Mac上的外观以及如何在两者之间共享代码?

3 个解决方案

#1


4  

At the moment, there's not an easy way of working with Mono for Android and MonoTouch when you are using Mono for Android on Visual Studio, Xamarin have two example applications (Tasky and TipCalc) that use shared code and logic but have different UIs, you can find these on their GitHub account: https://github.com/xamarin/mobile-samples

目前,当你在Visual Studio上使用Mono for Android时,没有一种简单的方法可以使用Mono for Android和MonoTouch,Xamarin有两个使用共享代码和逻辑但具有不同UI的示例应用程序(Tasky和TipCalc),你可以在他们的GitHub帐户上找到这些:https://github.com/xamarin/mobile-samples

There are various ways of sharing code across the three platforms, Jonas has a great video on achieving this that you can watch here: http://jonas.follesoe.no/2011/07/22/cross-platform-mobile-ndc-2011/ and hopefully Xamarin will make this easier in the future by providing an out of the box way of opening MonoTouch projects in Visual Studio (although you'll still need a Mac), that way you will have an easy way of coding between iOS, Android and WP7.

有三种方法可以在三个平台上共享代码,Jonas有一个很棒的视频来实现这一点,你可以在这里观看:http://jonas.follesoe.no/2011/07/22/cross-platform-mobile-ndc- 2011 /并希望Xamarin将来通过提供在Visual Studio中打开MonoTouch项目的开箱即用方式(虽然您仍然需要Mac),这将使您更容易,这样您将有一种简单的iOS编码方式,Android和WP7。

#2


1  

You would share the code using a source code control system or live using a shared drive. Some developers like to edit their code using Visual studio and tools like Resharper but still compile on the Mac. There are various tutorials on the web how to acheive this.

您可以使用源代码控制系统共享代码,也可以使用共享驱动器进行实时共享。一些开发人员喜欢使用Visual Studio和Resharper等工具编辑代码,但仍然可以在Mac上编译。网上有各种教程如何实现这一点。

#3


1  

There is a platform called Monocross that is built on the Xamarin Mono base. It helps you layout your code in a fashion that makes it easier to make your app compatible with different platforms.

有一个名为Monocross的平台,建立在Xamarin Mono基础上。它可以帮助您以一种方式布局代码,使您的应用程序更容易与不同平台兼容。

#1


4  

At the moment, there's not an easy way of working with Mono for Android and MonoTouch when you are using Mono for Android on Visual Studio, Xamarin have two example applications (Tasky and TipCalc) that use shared code and logic but have different UIs, you can find these on their GitHub account: https://github.com/xamarin/mobile-samples

目前,当你在Visual Studio上使用Mono for Android时,没有一种简单的方法可以使用Mono for Android和MonoTouch,Xamarin有两个使用共享代码和逻辑但具有不同UI的示例应用程序(Tasky和TipCalc),你可以在他们的GitHub帐户上找到这些:https://github.com/xamarin/mobile-samples

There are various ways of sharing code across the three platforms, Jonas has a great video on achieving this that you can watch here: http://jonas.follesoe.no/2011/07/22/cross-platform-mobile-ndc-2011/ and hopefully Xamarin will make this easier in the future by providing an out of the box way of opening MonoTouch projects in Visual Studio (although you'll still need a Mac), that way you will have an easy way of coding between iOS, Android and WP7.

有三种方法可以在三个平台上共享代码,Jonas有一个很棒的视频来实现这一点,你可以在这里观看:http://jonas.follesoe.no/2011/07/22/cross-platform-mobile-ndc- 2011 /并希望Xamarin将来通过提供在Visual Studio中打开MonoTouch项目的开箱即用方式(虽然您仍然需要Mac),这将使您更容易,这样您将有一种简单的iOS编码方式,Android和WP7。

#2


1  

You would share the code using a source code control system or live using a shared drive. Some developers like to edit their code using Visual studio and tools like Resharper but still compile on the Mac. There are various tutorials on the web how to acheive this.

您可以使用源代码控制系统共享代码,也可以使用共享驱动器进行实时共享。一些开发人员喜欢使用Visual Studio和Resharper等工具编辑代码,但仍然可以在Mac上编译。网上有各种教程如何实现这一点。

#3


1  

There is a platform called Monocross that is built on the Xamarin Mono base. It helps you layout your code in a fashion that makes it easier to make your app compatible with different platforms.

有一个名为Monocross的平台,建立在Xamarin Mono基础上。它可以帮助您以一种方式布局代码,使您的应用程序更容易与不同平台兼容。