Wednesday, March 22, 2023
HomeiOS Developmentios - How one can create picture shifting animation in dwell actions...

ios – How one can create picture shifting animation in dwell actions in swiftUI


enter image description hereThere’s the sleek automotive shifting animation in dwell actions (picture hooked up). How is the picture shifting animation achieved?

  • Tried utilizing a timer to replace picture offset/place, however this doesn’t work in Reside Actions.
  • Additionally tried utilizing a progressView (ProgressView(timeInterval)), nevertheless it doesn’t appear to permit including picture as its thumbnail

Current code:

ActivityConfiguration(for: DoTaskWidgetAttributes.self) { context in
        // Lock display screen/banner UI
        VStack(alignment: .main, spacing: 3) {
            
            Textual content(context.attributes.taskName).font(.system(dimension: 16)).foregroundColor(Colour(hex: "107FB4"))
            
            let countDownText = context.state.pausingTimeLeftString == nil ? Textual content(timerInterval: context.state.countDownTimer) : Textual content(context.state.pausingTimeLeftString!)
            countDownText
                .monospacedDigit()
                .font(.system(dimension: 25))
            
            Picture("cat")
                .resizable()
                .body(width: 25, top: 16)
            
            ProgressView(timerInterval: context.state.countDownTimer, countsDown: false) {
            } currentValueLabel: {
            }.tint(.black)
        }
        .activityBackgroundTint(.white)
        .activitySystemActionForegroundColor(.black)
        .foregroundColor(.black)
        .padding(EdgeInsets(prime: 8, main: 25, backside: 10, trailing: 25))
        
    }

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

1 × 2 =

Most Popular

Recent Comments