I have a UIProgressView in my storyboard connected to my code. I am trying to set progress to something non-zero.
Here is an example of my code that I posted in viewDidLoad.
[self.progressBar setProgress:(float)someValueBetween0.1and1.0 animated:NO];
However, what happens is that the progress bar will be at the value I set, and then quickly animate to 0.0. For example, if I set the stroke to 0.5, the panel will be filled halfway when the preview loads, and then drops to 0.0.
I tried using
self.progressBar.progress = (float)someValueBetween0.1and1.0;
That didn't work either.
I do not change the progress of the progress bar through code elsewhere. I tried Googling, read the link to the UIProgressView class, and looked for a stack overflow without any success: /
Edit: Created a new project with nothing more than a UIProgressView, to be sure that this is not something else in my code. Still not working.
#import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UIProgressView *testProgressView; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self.testProgressView setProgress:1.0 animated:NO]; }
source share