How to disable animation on Widget? Specifically, animation with Text(style: .timer)

While it's wonderful that the Widget provides animation and interaction capabilities, I've encountered a slight issue with the animation when using it to display a countdown. It tends to become bothersome.

Is there a method to disable the animation?

I have the same issue.

Text(value) Text(value).animation(nil) Text(value).animation(.none)

This does not work.

Try using .contentTransition(.identity). Does that help?

Hi reed.1325. Thanks for your answer. It works only for Text() element. For example, when updating a widget, I see a fade animation for some elements. This creates the blinking effect of the entire widget. I would like to be able to disable this animation.

deleted

Any solutions?

Find a solution:

VStack() { Text(entry.date, style: .time) Text(Calendar.current.startOfDay(for: Date()), style: .timer) .contentTransition(.identity) }

Found a solution! Check out Apple's documentation here: https://developer.apple.com/documentation/widgetkit/animating-data-updates-in-widgets-and-live-activities#Disable-animations. Using .transition(.identity) worked for me, as the documentation suggests.

Disable content animation use .contentTransition(.identity), disable view animation use .transition(.identity)

How to disable animation on Widget? Specifically, animation with Text(style: .timer)
 
 
Q