Xamarin.Forms: wrong button text alignment after click (Android)

前端 未结 1 1590
猫巷女王i
猫巷女王i 2020-12-29 07:58

I have a problem with Xamarin.Forms (version 1.2.2) on Android (Nexus 5). The alignment of Button.Text is often not centered after performing a click.

I

相关标签:
1条回答
  • 2020-12-29 08:42

    Ok, after hours of dealing with this silly bug, I resolved it by implementing a custom renderer and overriding ChildDrawableStateChanged:

    public override void ChildDrawableStateChanged(Android.Views.View child) 
    {
        base.ChildDrawableStateChanged(child); 
        Control.Text = Control.Text; 
    }
    
    0 讨论(0)
提交回复
热议问题