Creating progress circle as WKInterfaceImage in Watch App

前端 未结 6 1887
余生分开走
余生分开走 2020-12-14 11:17

I am trying to create a progress circle for the Apple Watch version of my app. I know that we aren\'t able to use UIViews (which would make things so much easier!) so I am l

6条回答
  •  臣服心动
    2020-12-14 11:29

    WKInterface classes are not able to be subclassed. Therefore, a custom control is not possible.

    Also, animation is limited. In order to create an animation, you must store every single frame as an image. Then, you can have an image view in your WatchKit app that cycles through these images.

    Store the images in the Images.xcassets folder in the watch target, and try to mess around with the changing the frame based on the percentage the activity is finished.

    One extra note: having 100 images would not be efficient, as each WatchKit app has only a limited amount of space on the watch it can take up (I believe it is 20MB, but I am not sure). Maybe have an image for every 5%.

提交回复
热议问题