将颜色存储在公共项目中以在 Android 和 iOS 之间共享
Store colors in common project to share between Android and iOS
我正在使用 Xamarin.Android 和 Xamarin.iOS 开发应用程序。我想将我的颜色值(十六进制、rgb 或其他)保留在一个公共项目中,以便 Android 和 iOS 项目都可以访问它们。有没有办法做到这一点?我也在使用 MvvmCross 那么是否有用于此的插件?或者这是个坏主意?
我将使用 Android 布局文件(.xml 文件)和两个平台的后端代码中的颜色。
Is there a way to do this? [Share colors between platforms]
是的,您可以使用 MvxColor
。*(有一些限制)
I'm also using MvvmCross so is there a plugin for this?
MvxColor
可通过 NuGet 上的插件获得。
Or is this a bad idea? [Share colors between platforms]
Use Case: I'm going to be using the colors in the Android layout files (.xml files) and back-end code for both platforms.
MvxColor
不会直接在 XML 中工作。但是可以通过绑定或通过后面的代码分配颜色来使用。因此,如果您想使用任何带颜色的 Android XML 设计时工具,那么 MvxColor
将不起作用。
我正在使用 Xamarin.Android 和 Xamarin.iOS 开发应用程序。我想将我的颜色值(十六进制、rgb 或其他)保留在一个公共项目中,以便 Android 和 iOS 项目都可以访问它们。有没有办法做到这一点?我也在使用 MvvmCross 那么是否有用于此的插件?或者这是个坏主意?
我将使用 Android 布局文件(.xml 文件)和两个平台的后端代码中的颜色。
Is there a way to do this? [Share colors between platforms]
是的,您可以使用 MvxColor
。*(有一些限制)
I'm also using MvvmCross so is there a plugin for this?
MvxColor
可通过 NuGet 上的插件获得。
Or is this a bad idea? [Share colors between platforms]
Use Case: I'm going to be using the colors in the Android layout files (.xml files) and back-end code for both platforms.
MvxColor
不会直接在 XML 中工作。但是可以通过绑定或通过后面的代码分配颜色来使用。因此,如果您想使用任何带颜色的 Android XML 设计时工具,那么 MvxColor
将不起作用。