【问题标题】:Maui with Material Design毛伊岛与材料设计
【发布时间】:2022-12-05 08:21:16
【问题描述】:

我是第一次构建 Maui 应用程序,并希望采用 Material Design。我通常根据项目使用 MahApps 或 Material Design。但是,添加资源字典时出现 Uri 错误

 <Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:Presentation"
    x:Class="Presentation.App">
 <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/Styles/Colors.xaml" />
                <ResourceDictionary Source="Resources/Styles/Styles.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignExtensions;component/Themes/Generic.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignExtensions;component/Themes/MaterialDesignLightTheme.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

代码每次都会崩溃,但如果我错过了最后 3 个资源字典(那些指的是 Material Design),我就不会遇到任何问题。我已经将 Material Design 添加为 NuGet 包以及扩展。谁能看到我所做的任何愚蠢的事情???

谢谢

【问题讨论】:

标签: c# wpf xaml material-design maui


【解决方案1】:

Dotnet MAUI 现在默认为 Android 提供 Material UI。您只需在 Android 文件夹中添加 using Google.Android.Material 行即可包含材料 ui。详细步骤请参考forum

【讨论】:

    猜你喜欢
    • 2022-08-07
    • 2021-07-26
    • 2022-06-14
    • 2022-08-22
    • 2023-02-09
    • 1970-01-01
    • 2022-10-01
    • 2022-09-27
    • 2023-01-11
    相关资源
    最近更新 更多