[Bug] [Forms][iOS] Vector in ToolbarItem too big
#6366 aperta il 31 mag 2019
Metriche repository
- Star
- (5644 stelle)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
Description
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 (Forms) 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.
The vector file I use is this one: https://us.v-cdn.net/5019960/uploads/editor/d2/7bolrbhfzoog.pdf
Steps to Reproduce
- Create a Forms project and iOS project
- Place a Vector file in the xcassets folder in the Universal field
- Set this Vector as ToolbarItem Icon
Expected Behavior
The graphic appears in the correct size on the right side of the toolbar
Actual Behavior
The graphic appears in the center and react on touches anywhere in the toolbar.
Basic Information
- Version with issue: Xamarin Forms 3.6.0.264807
- Last known good version: /
- IDE: Visual Studio Community for Mac 8.0.9 (Build 5)
- iOS:
- Affected Devices: iOS devices
Screenshots
