【发布时间】:2017-12-17 20:49:43
【问题描述】:
我正在使用 nugget 包 SVG.Forms.Plugin.Abstractions,我从一个简单的示例中复制了下面的 XAML,但无法显示 SVG。
图像位于“TestApp”应用程序的“图像”文件夹中,其构建操作是“嵌入式资源”。 SvgAssebly 绑定到 viewModel 下面的公共程序集。
我得到的只是一个空白屏幕,顶部有标题文本。
任何人都可以看到明显的错误吗?
public Assembly SvgAssembly
{
get { return typeof(App).GetTypeInfo().Assembly; }
}
XAML:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TestApp.MainPage"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:local="clr-namespace:TestApp;assembly=TestApp" Title="{ artina:Translate PageTitle}" BackgroundColor="{DynamicResource BasePageColor}"
xmlns:abstractions="clr-namespace:SVG.Forms.Plugin.Abstractions;assembly=SVG.Forms.Plugin.Abstractions">
<ContentPage.Content>
<StackLayout>
<abstractions:SvgImage
SvgAssembly="{Binding SvgAssembly }"
SvgPath="TestApp.images.brand.svg"
Width="200"
Height="200" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
【问题讨论】:
-
你关注什么设备平台?
标签: xaml xamarin svg xamarin.forms