Skip to content

Border on iOS redraws with 1 frame lag, creating flashes of (1) square corners on redraws, and (2) old background color before new color update #23070

@jonmdev

Description

@jonmdev

Description

In iOS, when Maui must redraw a Border, it does so with a 1 frame lag which is evident in two ways:

  1. The Border is sometimes re-drawn briefly fully square, causing a flash of a square over the corners (rather than the round corners expected)
  2. The old background color is still visible on update when it is changed for one frame, causing a visual flash of the old color each time

Steps to Reproduce

Reproduction project contains TWO reproduction demonstrations (one for each redraw problem, although they are likely the same underlying issue). To toggle between these projects, open App.xaml.cs and set TestProject here:

 enum TestProjects {
     testProject1, //==> DEMONSTRATES FLASH AT CORNERS OF LOWER SCREEN "HELLO" BORDER
                   //AS BORDER IS INITIALLY DRAWN SQUARE (RATHER THAN ROUND) ON THE FIRST "CLICK ME" BUTTON CLICK

     testProject2 //==> DEMONSTRATES FLASH OF PRIOR COLOR ON EACH UPDATE
                  //AS EACH TIME BORDER IS REDRAWN THE COLORATION LAGS ONE FRAME
 }
 public App() {

     //=================================
     //SET WHICH TEST PROJECT HERE
     //=================================
     TestProjects testProject = TestProjects.testProject1;
     //=================================

1) TestProject1

This shows a button on screen like this, which when clicked will alter the bottom Border. The bottom Border will flash on the first click made, creating the single frame square border effect shown on the "HELLO" border here:

issue-screencap

2) TestProject2

This shows a Border on screen which is automatically toggled by a timer visible or invisible. Each time the background color changes. However, you will see on each update the old color still flashes momentarily before the new one replaces it.

Notes:

Note that the slowest method of building (eg. Debug to device or simulator) is preferred to see the flashes for as long as possible so it is obvious to the eye.

Please note this is also NOT an animation effect - it is a 1 frame drawing lag which is separate from other issues, as animations in test project have been successfully removed by NotAnimatedBorderHandler.cs as per: #18204

@jsuarezruiz I know you were able to fix some of the Windows/Android Border drawing bugs previously reported and it has been appreciated. Any suggestions on a fix or workaround for this one for iOS? Thanks for any help.

Link to public reproduction project repository

https://github.com/jonmdev/iOSBorderShadowAnimationBug

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions