Reputation: 1914
I am trying to make a progress bar with 2 images. One of them is grey and the other picture is green. When I click the button, I want to progress it, but it is not working.
Here is the my code (progressGreen
and progressGrey
are UIImageView
s):
- (IBAction)nextButton:(id)sender {
self.progressGreen.tag = rowNumber; // I am giving a number
[self progess];
}
-(void) progess {
CGRect rect = self.progressGrey.frame;
rect.size.width = (rect.size.width * (self.progressGreen.tag)) / questions.count;
self.progressGreen.frame = rect;
}
What is my mistake?
Upvotes: 1
Views: 448
Reputation: 45598
Use the progressImage
and trackImage
properties on UIProgressView
. This will be much easier than doing it manually.
Upvotes: 1