本文介绍了Windows 10 移动版是否支持适用于 UWP 应用的 Fluent Design System?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Fluent Design System(亚克力背景和显示)开发新的 UWP 应用程序,但除了在 Windows 10 桌面版上可用之外,我还想将该应用程序发布到 Windows 10 移动版.Windows 10 Mobile 是否支持 Fluent Design System?还是我必须在没有 Fluent Design System 的情况下为 Windows 10 Mobile 开发另一个应用程序?

I'm developing a new UWP app with the Fluent Design System (Acrylic Background and reveal) but apart from being available on Windows 10 Desktop, I also want to publish the application to Windows 10 Mobile. Does Windows 10 Mobile support the Fluent Design System? Or do I have to develop another application just for Windows 10 Mobile without the Fluent Design System?

推荐答案

Windows 10 Mobile build 10.0.15063(创作者更新)支持合成效果以及应用内亚克力(请参阅 如何在 Windows 10 创意者更新中使用 Acrylic Accent?)并通过合成显示效果API.

Windows 10 Mobile build 10.0.15063 (Creators Update) supports composition effects as well as in-app acrylic (see How to use Acrylic Accent in Windows 10 Creators Update?) and reveal effects via the composition API.

但是,它支持 AcrylicBrushRevealBrush 类,因为这些类仅在版本 10.0.16299(Fall Creators更新)或更高版本,不适用于移动设备(当前的功能分支是内部版本 10.0.15254,也被称为秋季创作者更新",但实际上并不包含新的 API).

However, it does not support the AcrylicBrush or RevealBrush classes, as those classes are only available in build 10.0.16299 (Fall Creators Update) or later, which is not available for mobile devices (the current feature branch is build 10.0.15254, which is also dubbed the "Fall Creators Update" but does not actually include the new APIs).

虽然可以将 Fluent Design 元素整合到运行 Windows 10 移动版创意者更新的设备的 Windows 10 移动版应用中,但这样做的麻烦远远超过其价值.您将需要避免使用 AcrylicBrushRevealBrush,因为它们不适用于移动设备,并且您需要在应用程序内使用亚克力并以困难的方式显示效果.

While it is possible to incorporate Fluent Design elements into your Windows 10 Mobile app for devices running the Windows 10 Mobile Creators Update, doing so is far more trouble than it's worth. You will need to avoid using AcrylicBrush and RevealBrush since they're not available to mobile devices, and you will need to do in-app acrylic and reveal effects the hard way.

您无需为移动设备制作单独的应用程序;如果您的最低目标版本是 10.0.15063,您可以使用 条件 XAML 为移动设备提供遗留资源字典,为 PC 提供 Fluent Design.如果您的最低目标版本是不支持条件 XAML 的旧版本,您需要使用 Windows.Foundation.Metadata.ApiInformation.IsTypePresent() 来检查 AcrylicBrush和/或 RevealBrush手动将适当的资源字典合并到您的Application.Current.Resources中.

You don't need to make a separate app for mobile; if your minimum target version is 10.0.15063 you can use conditional XAML to serve a legacy resource dictionary to mobile devices and Fluent Design to PCs. If your minimum target version is an older version that doesn't support conditional XAML, you need to use Windows.Foundation.Metadata.ApiInformation.IsTypePresent() to check for AcrylicBrush and/or RevealBrush and merge the appropriate resource dictionary into your Application.Current.Resources manually.

这篇关于Windows 10 移动版是否支持适用于 UWP 应用的 Fluent Design System?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:09