无法在Xamarin.Forms中绑定SVG图像

时间:2018-04-02 13:20:00

标签: xamarin.forms

我无法在xamarin.forms gridview中绑定svg图像。我有一个网格视图,我想添加9行/列与.SVG图像

<StackLayout Grid.Row="0" Grid.Column="0" BackgroundColor="#BF4E21" Spacing="1">
    <StackLayout>
        <abstractions:SvgImage HeightRequest="50" HorizontalOptions="Center" SvgAssembly="{Binding SvgAssembly}" SvgPath="{Binding CoolMaskSvgPath}" VerticalOptions="Center" WidthRequest="50" />
    </StackLayout>
    <StackLayout>
        <Label Text="Men" TextColor="Black" VerticalOptions="Center" HorizontalOptions="Center" />
    </StackLayout>
</StackLayout>
public Assembly SvgAssembly => typeof(App).GetTypeInfo().Assembly;
public string CoolMaskSvgPath => "001-travel-1.svg";

public LookUp()
{
  InitializeComponent();
  BindingContext = this;
}

0 个答案:

没有答案