locked
CALayer.MasksToBounds not always working in Xamarin.Forms custom Frame renderer RRS feed

  • Question

  • User74 posted

    Hi all, I have had to create a custom renderer for our Xamarin.Forms Mac project to implement the XF Layer.IsClippedToBounds property which hasn't been implemented yet in XF for Mac. I am doing that by using the native Layer.MasksToBounds property, but it doesn't clip on the first display, only on the second. Is there anything more I need to do?

    Thanks John

    Sunday, April 5, 2020 2:59 PM

Answers

  • User74 posted

    I figured it out, I could see that the VisualElementTracker was setting Layer.MasksToBounds to false! Thankfully the VisualElementRenderer has a virtual method called UpdateNativeWidget, which is where I can set the value accordingly.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Sunday, April 5, 2020 4:36 PM