diff --git a/src/Core/src/Platform/Android/ImageButtonExtensions.cs b/src/Core/src/Platform/Android/ImageButtonExtensions.cs index d6a9b2158bac..7606df45bd32 100644 --- a/src/Core/src/Platform/Android/ImageButtonExtensions.cs +++ b/src/Core/src/Platform/Android/ImageButtonExtensions.cs @@ -36,6 +36,9 @@ public static async void UpdatePadding(this ShapeableImageView platformButton, I // https://github.com/material-components/material-components-android/issues/2063 await Task.Yield(); + if (!platformButton.IsAlive()) + return; + // We must re-set all the paddings because the first time was not hard enough. platformButton.SetContentPadding((int)padding.Left, (int)padding.Top, (int)padding.Right, (int)padding.Bottom); platformButton.SetPadding(0, 0, 0, 0);