我找到了解决办法。
如果我有
ms-appx:///
在值中,这被视为
UriImageSource
而不是
FileImageSource
. 如果我把这个切下来用
满的
图标的路径(包括部件名称),也会显示UWP的图标。
<Image WidthRequest="24" HeightRequest="24" VerticalOptions="Center"
HorizontalOptions="End">
<Image.Source>
<OnPlatform x:TypeArguments="ImageSource">
<On Platform="Android,iOS" Value="icon" />
<!-- Icon name prefixed with assembly name -->
<On Platform="UWP" Value="Base.Library.Uwp/Icons/icon.png" />
</OnPlatform>
</Image.Source>
</Image>