xamarin/Xamarin.Forms

[Android] Image on Button is not centered with text

オープン

#3,527 opened on 2018/08/09

 (15 件のコメント) (4 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
a/buttone/3 :clock3:help wantedinactivep/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

The Image is not in the center on Button when displaying with a text.

Steps to Reproduce

  1. Create a Button with an image & text.
  2. Set thee HorizontalOption to Fill&Expand.
  3. You can see that the image is stick to the left border
  4. If you change the position(Top,Right...) of the image it will stick on the position selected, not centered with the text

Expected Behavior

The image have to stick the text on the center.

Actual Behavior

The Image is stick to the border depends of the selected position. I was searching a way to make a correction on UpdateBitmap But PropertyName "Image" never pass to UpdateBitmap

        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == Button.TextProperty.PropertyName)
                UpdateBitmap();

            base.OnElementPropertyChanged(sender, e);
        }

Basic Information

  • Xamarin.Forms: 3.1.0.697729
    • Android: 8.1

コントリビューターガイド