Xamarin Whitelabel应用程序 [英] Xamarin whitelabel apps

查看:54
本文介绍了Xamarin Whitelabel应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的项目研究Xamarin解决方案.

I'm investigating Xamarin solution for my project.

项目要求是:

  • IOS应用

  • IOS app,

Android应用

MacOS应用

Windows 7,8,10应用程序.

Windows 7,8,10 app.

我已经基于MvvmCross构建了测试解决方案,并且效果很好.

I already build test solution based on MvvmCross and it works fine.

我的问题是,如何为所有基于我的测试解决方案的平台构建白标应用程序?在这些应用程序中,我将仅更改资源,例如字符串,图标,字体等,但逻辑,视图和UI相同.

My question is, how can I build whitelabel apps for all platforms that will be based on my test solution? In those apps I will change only resources, such as Strings, icons, fonts...and so on, but logic, views and UI will be the same.

有没有办法像android中的gradle(构建变体)那样做?

Is there any way to do it like gradle in android (build variants) ?

推荐答案

MSBuild 具有很多功能,并且可以实现与 gradle 的构建变体类似的功能.但是,如果您没有 MSBuild 的背景知识,那么深入研究这些东西就很复杂.

MSBuild has a lot of features and can certainly achieve something similar to what gradle has with build variants. However, it is complicated to dive into that stuff if you don't have a background with MSBuild.

我认为这可能是更简单的方法(以及我会做的事情):

I think this might be the easier approach (and what I would do):

  • 使用项目来组织一切
  • 将所有跨平台代码保留在共享项目(或PCL)中
  • 在每个平台的共享项目中保留所有Windows,iOS,Android专用代码
  • 为应用程序的每个样式/平台创建一个启动项目,并引用共享项目.如果您愿意,可以为应用程序的每种样式添加预处理器定义.

在启动项目中,您可以包括不同的字符串资源,图像等.此外,还请研究如何在Visual Studio/Xamarin Studio中使用文件链接",因为这将帮助您摆脱困境(尤其是如果您的应用程序的不同风格会以不同的方式发生变化.

In the startup projects you can include different string resources, images, etc. Also look into how to use "file-linking" in Visual Studio/Xamarin Studio, as it will help you out of tight spots here--especially if the different flavors of your app vary in different ways.

这篇关于Xamarin Whitelabel应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆