dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.74k stars 1.64k forks source link

Border has an unexpected background animation #21643

Open zeniya-takeshi opened 1 month ago

zeniya-takeshi commented 1 month ago

Description

When the BackgrondColor or CornerRadius of a Border is changed, unexpected animation occurs on iOS. This is not a duplicate of https://github.com/dotnet/maui/issues/18204

18204 workaround(NotAnimatedBorderHandler) can't solve this.

iOS(BackgroundColor)

https://github.com/dotnet/maui/assets/40626279/165f9c1c-0cb6-48f3-a83e-5cc65d9b92c4

iOS(CornerRadius)

https://github.com/dotnet/maui/assets/40626279/4fcd87c3-d9b1-4c0b-98b9-ee5181941ffe

Android(BackgroundColor) (This is not problem)

https://github.com/dotnet/maui/assets/40626279/034bdcee-7b40-400a-946e-79a8991f4f97

Steps to Reproduce

  1. create a Border
  2. change its Background or CornerRadius

Link to public reproduction project repository

https://github.com/zeniya-takeshi/BorderHasBackgroundAnimation.git

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 17

Did you find any workaround?

Use Frame. But Microsoft recommends that developers use Border.

Relevant log output

No response

RoiChen001 commented 1 month ago

Can repro this issue at iOS platform on the latest 17.10 preview 2(8.0.6&8.0.14).

Phenek commented 1 week ago

Border within a CollectionView appears to have a default BackgroundColor animation. This seems to be related to this issue.

This can be observed at the bottom of the CollectionView, where views are recycled with different colors. It can be see also on top, but it is less relevant due of the light color.