在 Xamarin 中创建自定义样式 [英] Create custom styling in Xamarin

查看:27
本文介绍了在 Xamarin 中创建自定义样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将在 Xamarin 中开始一个新项目,因为我们需要为 Android 和 iOS 创建一个移动应用程序.但我们要求两个平台看起来完全一样.

I'm about to start a new project in Xamarin, since we need to create a mobile app for Android and iOS. But we require that both platforms look exactly the same.

是否可以使用 Xamarin 来做到这一点,还是只能使用 Cordova 之类的东西?

Is it possible to do this using Xamarin or is it only possible using something like Cordova?

谢谢!

推荐答案

要求两个平台看起来完全一样

这取决于你所说的那句话是什么意思.

It depends upon what you mean by that statement.

关于 Xamarin.Forms,本机"小部件在每个平台上使用,因此部署到不同平台的相同"应用程序的 UI 看起来会有所不同(差异可能很小或因所使用的控件而异).

In regards to Xamarin.Forms, "native" widgets are used on each platform so the "same" app's UI, deployed to a different platform, will look different (the difference can be slight or vary greatly based upon the controls used).

基于 Web 的/混合应用程序在每个平台上的呈现方式往往完全相同.每个平台都有自己的 HTML/CSS 渲染引擎,因此存在差异,因此 CSS 可以因平台而异,以获得所需的相同".

Web based / Hybrid apps tend to render fairly the same on each platform. Each platform does have its own HTML/CSS rendering engine so there are differences, and thus the CSS can vary from platform to platform to obtain the desired "sameness".

有些 GUI 框架可以呈现自己的控件/小部件,并且不使用平台本机"控件/小部件.虽然其中很多往往是与游戏相关的 UI 框架,但根据您的需求,有许多可用选项.

There are GUI frameworks that render their own controls/widgets and do not use the platform "native" ones. While a lot of these tend to be game related UI frameworks, there are many options available depending upon want you requirements are.

  • OmniGUI:一个 Xamarin.Forms 友好的跨平台,呈现自己的控件,因此在每个平台上看起来都一样.

  • OmniGUI : A Xamarin.Forms friendly cross-platform that renders its own controls and thus looks the same on each platform.

Flutter:Google 的移动 UI 框架,可呈现自己的小部件".虽然有应用了 Material Design 和 Cupertino 样式的小部件集合,但您可以使用基本小部件,并使用 Google 的 Dart 语言在类似CSS"的CSS"中设置样式.

Flutter : Google's mobile UI framework that renders its own "widgets". While there are widget collections that have Material Design and Cupertino styles applied, you can use the basic widgets and style them in a "CSS" like analog using Google's Dartlanguage.

许多其他...

这篇关于在 Xamarin 中创建自定义样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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