Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a Right-to-Left progress bar possible on iOS?

I've tried sending [UIProgressView setProgress] negative values, and that doesn't work.

Is there some other way to get a progress bar that fills from the right-hand end?

like image 459
James Avatar asked Apr 23 '11 19:04

James


People also ask

How do I display progress bar in react native?

To work with the progress bar component install react-native-paper module using npm. It takes value from 0 to 10. The number value to be given to show inside the progress bar. The color of the progress bar.

How do I increase the height of progress view in Swift?

Instead of using . transform to increase the height, you need to use a height constraint on the progress bar. This will increase the height and . cornerRadius will act as expected.


1 Answers

You could try setting the transform property of your UIProgressView to a new CGAffineTransform that rotates the view by 180 degrees and flips it vertically (to preserve the "shininess") (see CGAffineTransformMake() and CGAffineTransformRotate()).

Something along the lines of:

UIProgressView *pv = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
pv.frame = CGRectMake(10, 100, 300, 11);
CGAffineTransform transform = CGAffineTransformMake(1, 0, 0, -1, 0, pv.frame.size.height); // Flip view vertically
transform = CGAffineTransformRotate(transform, M_PI); //Rotation angle is in radians
pv.transform = transform;
pv.progress = 0.5;
like image 165
Kyle Avatar answered Oct 14 '22 22:10

Kyle