Skip to content

[regression/8.0.3] Flickering occurs due to padding while navigating pages. #18875

@cropyai

Description

@cropyai

Description

Hi,

I prepared an example project to describe the bug. The bug happens when navigating pages. The imagebutton component first shows the full scale image without considering the padding property for a couple of frames. Then, the image is drawn correctly considering the padding property. The bug happens in both debug and release mode.

x.mp4

The only code added to the project is:

In the MainPage.xaml:

<ImageButton
    Source="dotnet_bot.png"
    HeightRequest="100"
    WidthRequest="100"
    Padding="50"
    BackgroundColor="Yellow"
    />

In the MainPage.cs:

private void OnCounterClicked(object sender, EventArgs e)
{
    count++;

    if (count == 1)
        CounterBtn.Text = $"Clicked {count} time";
    else
        CounterBtn.Text = $"Clicked {count} times";

    SemanticScreenReader.Announce(CounterBtn.Text);

    Navigation.PushAsync(new MainPage(), false);
}

Other than that, there is another bug with the padding property however it is being tracked in a different issue.

EDIT - Another bug: "When I click previous button to go to the previous page, the imagebutton in the previous page is rendered wrong. It does not consider any padding anymore."

Steps to Reproduce

  1. Create a new maui project (.NET 8 Android)
  2. Add one imagebutton as described.
  3. Add navigation code.
  4. Run the project.
  5. Navigate pages.
  6. Flickering happens.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-buttonButton, ImageButtonpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidpotential-regressionThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versions/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions