Forum Xamarin.Forms

iOS ToolbarItem Icon from Vector too big

GraverobberGraverobber Member ✭✭✭
edited May 2019 in Xamarin.Forms

Hello everyone,

I'm trying to set an Icon for my Toolbar Item (for iOS).
I did put the graphic (pdf) under the Vector field in my Assets.xcassets Universal field.

Then I place the Icon in code like this:

ToolbarItem arrangeItem = new ToolbarItem
                {
                    Icon = "Arrange.png",
                    Order = 0,
                    Command = (BindingContext as MainPageViewModel).ArrangeClickedCommand

                };
                this.ToolbarItems.Add(arrangeItem);

Please note, I also tried with just Icon = "Arrange" as the name of the asset is Arrange. But I think as the compiler is creating the x1 x2 x3 anyway .png will work as well?

For some reason, the icon then appears in the center of the Toolbar

As you can see, the title is also "gone"

First I thought it might be just placed incorrectly but clicking anywhere in the Toolbar will cause the icon to trigger so I assume it just is super big or something.
Additionally, if I remove the Icon and use a Text then everything is normal.

How can I have the Vector to have the right size? Or act "normal"?
One more point, where can I find the generated x1 x2 x3 graphics of the generated binary?

Thank you all!

Answers

Sign In or Register to comment.