George Ciobanu
George Ciobanu

Reputation: 655

CERoundProgressView set maximum value less than 1.0

Is there any way to set the maximum value of a CERoundProgressView object to be less than 1.0 - something like 0.5?

Reference: CERoundProgressView

Upvotes: 1

Views: 175

Answers (2)

Lance
Lance

Reputation: 9012

You could always subclass CERoundProgressView, add properties for max and min.

@property (nonatomic, weak) float max;
@property (nonatomic, weak) float min;

set max to 0.5, set min to be 0.1 if you want

Then, override setProgress:(float)progress animated:(BOOL)animated; with something like this:

- (void) setProgress:(float)progress animated:(BOOL)animated {
    float value = ((progress - self.min) / (self.max - self.min) ) * (1.0 - 0.0);
    [super setProgress:value animated:animated];
}

Upvotes: 1

user529758
user529758

Reputation:

There seems to be no property to alter the range of the progress. However, since this project is opensource, you can easily adjust the class to use simple linear interpolation.

Upvotes: 0

Related Questions