Juan Wayne
Juan Wayne

Reputation: 35

Xamarin Forms ToolbarItem Icon from URL

I've got a problem: In my Xamarin Forms project I want to show an Icon in the top left corner, but the image is only via url available.

This is my Code:

var toolbaricon = new ToolbarItem();
toolbaricon.Icon = "urlToImage";
ToolbarItems.Add(toolbaricon);

The Item gets added to the ToolbarItems, but doesn't show up. But if I use a local Image (image from drawable (android)) it works fine.

Is there a solution for this?

Best Regards

Upvotes: 2

Views: 643

Answers (1)

Steven Thewissen
Steven Thewissen

Reputation: 2981

The ToolBarItem inherits MenuItem which needs a FileImageSource as its Icon property. This means it only accepts images from the platform resource folder. That means that you can't use an image from a URL.

Upvotes: 1

Related Questions