1

How can I display a UIProgressView with a percentage?

Arnaud
  • 7,259
  • 10
  • 50
  • 71
Kunal
  • 83
  • 1
  • 2
  • 11
  • With the default UIProgressView class you can't do it. You try this by making a custom UIProgressview. – Exploring Mar 04 '13 at 12:09
  • Please try this [link](http://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=progress), There you can find lots of controls and demos which can help you out :) – The iOSDev Mar 04 '13 at 12:34

3 Answers3

5

As Vlad mentioned you can have a method which updates the value of progressView and its associated label. Call the following method when any update happens.

- (void)updateProgress
{
    CGFloat stepSize = 0.1f;
    [self.progressView setProgress:self.progressView.progress+stepSize];
    self.progressLabel.text = [NSString stringWithFormat:@"Completed : %.0f",self.progressView.progress*100];
}
Anupdas
  • 10,211
  • 2
  • 35
  • 60
3

The progress indicator control does not offer the option of also displaying progress percent. In order to achieve this, one solution would be to add a label positioned below / above your progress bar, and at each step when you refresh the progress on your progress indicator view, you also update the string value in on your label to display the percentage loaded.

Vlad
  • 3,346
  • 2
  • 27
  • 39
3

There is one widget already available in iOS SDK - UIProgressView

Where you can set and get its property: progress

Hope this may help you.

Mrunal
  • 13,982
  • 6
  • 52
  • 96