Usage of Rotation property or RotateTo extension method on circle button causes that button disappears partially. This bug happens only on Android 7 and Android 8.
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Button
x:Name="PlusButton"
BackgroundColor="#f45f06"
Clicked="PlusButton_OnClicked"
CornerRadius="32"
HeightRequest="64"
ImageSource="plus_icon"
Rotation="45"
WidthRequest="64" />
</StackLayout>In Code Behind create method PlusButton_OnClicked with this implementation:
` private bool _rotated;
private void PlusButton_OnClicked(object sender, EventArgs e)
{
if (!_rotated)
{
_rotated = true;
PlusButton.RotateTo(45, 100, Easing.Linear);
}
else
{
_rotated = false;
PlusButton.RotateTo(0, 100, Easing.Linear);
}
}`
Button is fully visible on screen
Button disappears partially

@Skirtek Workaround for this fix is to disable Draw() method in
FastButtonRenderer
public override void Draw(Canvas canvas)
{
if (_backgroundTracker?.BackgroundDrawable != null)
_backgroundTracker.BackgroundDrawable.DrawCircle(canvas, canvas.Width, canvas.Height, base.Draw);
else
base.Draw(canvas);
}
And same method in MaterialButtonRenderer
public override void Draw(Canvas canvas)
{
if(Element == null || Element.CornerRadius <= 0)
{
base.Draw(canvas);
return;
}
try
{
var radiusToPixels = (float)Context.ToPixels(Element.CornerRadius);
using (var path = new Path())
{
RectF rect = new RectF(0, 0, canvas.Width, canvas.Height);
path.AddRoundRect(rect, radiusToPixels, radiusToPixels, Path.Direction.Ccw);
canvas.Save();
canvas.ClipPath(path);
base.Draw(canvas);
}
canvas.Restore();
return;
}
catch (Exception ex)
{
Internals.Log.Warning(nameof(MaterialButtonRenderer), $"Unable to create circle image: {ex}");
}
base.Draw(canvas);
}
This bug was introduced in Xamarin.Forms 4.4.0.991440 as a solution to fix some clipping issues:)
@yurkinh Thank you for your answer! Could you explain wider how to disable this method? Overriding in custom renderer does not give any effect :(
@Skirtek Actually you should just remove this method form both renderers not override. I can make custom nugets for you to test it on your project or you can install Xamarin.Forms 4.4.0.991265
Fixed in 4.5.0.530 (update: older Android only. Still broken in 8, 9 10)
@mdbill Sorry but I cannot agree. I confimed it happenes in version 4.5.0.530 (SR3) for example on Android 8.1
@Skirtek Ah, good thing you spoke up. My problem was added to this as a duplicate--which we now know it was not since my problem went away. Maybe 617 will work for you? Anyway, good luck!
I found that thisclipping problem also exists in XF 4.4.0.991265 leaving me with no version of XF that works with rotation (note: it's not just animation, simply static rotation is enough). Happens on Android 7.1.2, release builds (not debug)
But! have a workaround! If I set Opacity to 0.99 (or less) all is well. Hope this helps.
@mdbill I'm glad that you have found solution. I can confirm that works on Android 7 and 8 and it could be (not dirty) workaround until Team Xamarin fix this :)