xamarin/Xamarin.Forms

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

Aperta

#6632 aperta il 23 giu 2019

 (2 commenti) (1 reazione) (0 assegnatari)C# (1926 fork)batch import
e/5 :clock5:help wantedp/Androidt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor