空的 Uno 项目,添加标签给我错误“XML 命名空间‘http://schemas.microsoft.com/winfx/2006/xaml/presentation’中的未知类型‘标签’”

问题描述

我正在努力让一个简单的 Label 控件在 Uno 项目中工作。为了让事情尽可能简单,我创建了一个全新的 Uno App 项目,并在我的“共享”项目中,在 MainPage.xaml 上,向认网格添加一个标签元素,如下所示:

<Page
    x:Class="UnoLabel.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UnoLabel"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Label Content="Hello" />
        <TextBlock Text="Hello,world!" Margin="20" FontSize="30" />
    </Grid>
</Page>

当我尝试运行它时,出现以下错误

UnkNown type 'Label' in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'

我还注意到在 ToolBox 中,没有我可以点击的 WYSIWYG 编辑器的标签控件。

Label 不是 Uno 中的正常控件吗?如果是这样,适当的替换控制是什么?文本框设置为只读?如果它应该在那里,有什么关于如何找到它的帮助吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)