简体   繁体   English

Xamarin.Forms:UWP,WinPhone的样式不同

[英]Xamarin.Forms: Styling is not the same for UWP, WinPhone

In Android looks like OK. 在Android中看起来不错。 But UWP looks ugly. 但是UWP看起来很丑。 Font-size is too big. 字体大小太大。 Controls are too big. 控件太大。

在此处输入图片说明

But UWP app is bad: 但是UWP应用不好:

在此处输入图片说明

Is it possible to make it a little bit the same. 是否有可能使它有点相同。 I understand it has different theme. 我了解它有不同的主题。 But how I can overide it? 但是我该如何克服呢? Change font-size for whole app? 更改整个应用程序的字体大小?

Checkout OnPlatform - it allows you to specify different values for different platforms. Checkout OnPlatform-它允许您为不同的平台指定不同的值。 If you create some styles for your controls you can set the font size depending on platform using this trick. 如果您为控件创建一些样式,则可以使用此技巧根据平台设置字体大小。

There's an example of using OnPlatform on the Xam developer site, half way down this page: Xam开发人员网站上有一个使用OnPlatform的示例,位于此页面的一半以下:

https://developer.xamarin.com/guides/xamarin-forms/xaml/xaml-basics/essential_xaml_syntax/ https://developer.xamarin.com/guides/xamarin-forms/xaml/xaml-basics/essential_xaml_syntax/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM