Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Image Set in a Xamarin Forms

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>
like image 386
Stam Avatar asked Apr 22 '16 14:04

Stam


People also ask

How do I insert an image into drawable in Xamarin?

In case of Android: drag and drop the image in 'drawable-hdpi' folder under Resources, and make sure the build action in properties is set to 'AndroidResource'.

What is the difference between entry and editor in Xamarin forms?

The Editor is very similar to the Entry in that it allows users to enter some free-form text. The difference is that the Editor allows for multi-line input whereas the Entry is only used for single line input. The Entry also provides a few more properties than the Editor to allow further customization of the View.

Can Xamarin use Visual Studio code?

NET MAUI -- basically Xamarin. Forms supporting desktop apps -- can be used with Visual Studio Code, the super-popular, open source-based, cross-platform code editor.


1 Answers

Yes you can.

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

enter image description here

my xaml

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

Result

enter image description here

Note

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

like image 151
Sven-Michael Stübe Avatar answered Sep 24 '22 11:09

Sven-Michael Stübe