Hello all i am new in Apple Watch development and Is there any way to display progress bar in Apple Watch? I have one application in which there is progress bar which updated with user location. i implemented same thing in iPhone but now i want to implement same thing in Apple Watch. Is there any possible way to do this?
The most simple way for a solid-color progress bar in watchOS 2+ requires 1 image:
progressBarImage.setRelativeWidth(CGFloat(currentValue / maxValue), withAdjustment: 0)
whenever the current value changes.If you want a vertical progress bar, there is afunction for that: progressBarImage.setRelativeHeight(CGFloat(currentValue / maxValue), withAdjustment: 0)
.
You could also create the image dynamically on the phone. I leave this as an exercise for the reader.
There is not a progress bar in WatchKit at the moment.
A fairly easy workaround would be to design a WKInterfaceImage that looks like a progress bar along with the progressive images to fill in the bar. Then update the current image displayed to match the percentage that your user's location has progressed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With