是否可以在 Xamarin 表单中使用图像集 [英] Is it possible to use Image Set in a Xamarin Forms

查看:16
本文介绍了是否可以在 Xamarin 表单中使用图像集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Xamarin.Forms 项目中添加一些图像作为图像集.我遵循了这个

我的 xaml

</图片>

结果

注意

您可能需要删除 mtbs(在 Mac 上)和 bin/obj(在您的项目上),否则构建缓存可能会欺骗您 :)

I am trying to add some Images as Image Sets in a Xamarin.Forms project. I followed this guide . But the icon is not displayed. Is it possible actually to use Image Sets in a Xamarin Forms Solution for the iOS project?

<Image VerticalOptions="Center"
                    HorizontalOptions="End"
                    Source="check_outline_500_active.png"
                    WidthRequest="40">
                    </Image>

解决方案

Yes you can.

  • create the Asset catalog
  • add Image Set and name it "check_outline_500_active" (without .png)
  • add the images
  • done

my xaml

<Image VerticalOptions="Center"
    HorizontalOptions="Center"
    Source="check_outline_500_active.png">
</Image>

Result

Note

You might have to delete mtbs (on the mac) and bin/obj (on your project) or the build cache can fool you :)

这篇关于是否可以在 Xamarin 表单中使用图像集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆