Is there a way to center the text and image on a button? I want the image to be on top and text below, both centered on button.
I'm trying to use a custom renderer on android like this
class MenuButtonRenderer: ButtonRenderer
{
protected override void OnElementChanged (ElementChangedEventArgs<Xamarin.Forms.Button> e)
{
base.OnElementChanged (e);
if (e.OldElement == null) { // perform initial setup
var nativeButton = (global::Android.Widget.Button)Control;
nativeButton.Gravity = (global::Android.Views.GravityFlags.CenterHorizontal | global::Android.Views.GravityFlags.CenterVertical);
nativeButton.SetPadding (20, 30, 0, 0);
}
}
}