Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug][Android] The icon of the Button is not centered #9561

Closed
AhmetCavus opened this issue Feb 13, 2020 · 2 comments
Closed

[Bug][Android] The icon of the Button is not centered #9561

AhmetCavus opened this issue Feb 13, 2020 · 2 comments
Labels
a/button a/fonticon s/unverified New report that has yet to be verified t/bug 🐛

Comments

@AhmetCavus
Copy link

AhmetCavus commented Feb 13, 2020

Description

In Android:

If an icon is set in the Xamarin Forms Button via ImageSource, it will be centered correctly without text. As soon as the text is set , the icon is positioned on the far left.
It does not matter if I use a vector drawable or a PNG. The behaviour occurs with both variants.

Here is the code in xaml:

<Button HeightRequest="41" HorizontalOptions="FillAndExpand" ImageSource="cart_icon" Text="Add" />

This problem was already reported in older versions:
#5861
#9227

Steps to Reproduce

  1. Place a Button control into a xaml page
  2. Set the ImageSource with a path of an icon
  3. Finally, add a text in the button

Expected Behavior

The icon is correctly centered before the text

Actual Behavior

The icon is positioned on the far left

Basic Information

  • Version with issue: 4.4.0.991477
  • IDE: Visual Studio Mac 8.4.3
  • Platform Target Frameworks:
    • Android: 10.0

Screenshots

A screenshot from the issue:
image

@AhmetCavus AhmetCavus added s/unverified New report that has yet to be verified t/bug 🐛 labels Feb 13, 2020
@AhmetCavus AhmetCavus changed the title The icon [Bug][Android] The icon of the Button is not centered Feb 13, 2020
@MhAllan
Copy link

MhAllan commented Feb 14, 2020

#9227

@PureWeen
Copy link
Contributor

I'm going to close this one in favor of #9227

Currently we can't change the default way it displays on android but it should be fixable if the user configures.

if you use the Material Buttons with the Material Visual Renderers that centers correctly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/button a/fonticon s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants