xamarin/Xamarin.Forms

[Bug] Icon not correctly centered with text when using FontImageSource

Open

#6,632 opened on Jun 23, 2019

 (2 comments) (1 reaction) (0 assignees)C# (1,926 forks)batch import
e/5 :clock5:help wantedp/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

In a button, icon is not correctly centered with the text.

Steps to Reproduce

  1. Add a button to a page with a text and an icon using FontImageSource
  2. Set ContentLayout property of the button to "Left,0"
  3. Launch the app an go to the page

Expected Behavior

Icon and text are centered in the button, the icon appears just on the left of the text without space between them.

Actual Behavior

Text is centered in the button but the icon is not, there is a lot of space between text and button. It seems that ContentLayout property is not taken into account.

Basic Information

  • Version with issue: Xamarin Forms 4.1
  • IDE: VS 2019
  • Platform Target Frameworks: Only tested on Android
    • Android: 9.0
  • Nuget Packages: Nuget from the default Shell templates
  • Affected Devices: All devices

Screenshots

FontImageSource_Issue

The button "SomeText" on the screenshot shows the icon not correctly centered.

Reproduction Link

Github repo : https://github.com/TechWatching/FontImageSourceIssue

Contributor guide