How to play gif in widget? "网易云音乐" and "one widget" can play gif in the widget. can anyone guide me. Thank you
How to play gif in widget?
Well, what have you tried? What code are you trying to use that isn't working? I mean, I'll just say use: Image("myImage.gif")
. Does that work?
Thank you for your reply. I tried Timer
and CADisplayLink,
but they are all "invalid" in the widget. Image can be rotated by _clockHandRotationEffect(.secondHand, in: .current, anchor: .center)
, but it has been disabled in Xcode 14. For the method you mentioned, Image (uiImage: UIImage (contentsOfFile: "animated. gif")) can only display the first frame.
@darkpaw
Hello, I also have the same problem, have you found a solution?
你好,我也遇到了同样的问题,请问你找到解决办法了吗?
没有找到解决方案@past
You may find success using a custom font which contains your own glyphs and a SwiftUI timer which would essentially swap your characters on each invocation (each second). Apple does not provide native support for .gif. The closest thing would be an .apng but those would not work in Widgets either.
Hello, I also have the same problem, have you found a solution? ClockHandRotationKit not working on iOS 13