Skip to content

[iOS] RotateTo visually rotates through the layers that are on top #30251

Open
@sjorsmiltenburg

Description

@sjorsmiltenburg

Description

In my maui.ios app I do a 'flip' animation with

  • PreviewFrontImage.RotateYTo(-90, animationTime, Easing.SpringIn)
  • change the image
  • PreviewFrontImage.RotateYTo(0, animationTime, Easing.SpringOut),

The image that I am rotating is temporarily shown 'through' the images that are on top. This only happen on iOS, not on Android or Windows.
This did not happen in the Xamarin.Forms version of my iOS app.

How can I combat this?

I tried z-index 9999 on the images, and setting ShouldRastarize to true during the animation, but it did not help

public static void SetShouldRasterize(View view, bool enable) { #if IOS var handler = view?.Handler; if (handler?.PlatformView is UIView nativeView) { nativeView.Layer.ShouldRasterize = enable; nativeView.Layer.RasterizationScale = UIScreen.MainScreen.Scale; } #endif }

Steps to Reproduce

add an image
position another image partially on top of it, do this by defining it later/lower in the xaml
let the bottom image animate
See that during the animation the animated image sticks 'through' the top image.

Link to public reproduction project repository

https://github.com/sjorsmiltenburg/maui_bugs

Version with bug

9.0.70 SR7

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-imageImage loading, sources, cachingplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions