Skip to content Skip to sidebar Skip to footer

Xamarin.forms: Wrong Button Text Alignment After Click (android)

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. In a short project, I figured

Solution 1:

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; 
}

Post a Comment for "Xamarin.forms: Wrong Button Text Alignment After Click (android)"