1

I'm using a UIProgressView in my application, which is working great right now. But I want to make it larger (height-wise) and color it a different color.

I'm looking to use PDColoredProgressView for the color, and alter the -(void)drawRect:(CGRect)rect method to change the height, however I can't decide where I would actually alter the height. Any suggestions on what to change?

jszumski
  • 7,430
  • 11
  • 40
  • 53
DVG
  • 17,392
  • 7
  • 61
  • 88

3 Answers3

3

So it turns out you can resize it like any other view.

[coloredProgressView setFrame:CGRectMake(0, 0, 300, 25)];
DVG
  • 17,392
  • 7
  • 61
  • 88
2

Setting the frame side didn't seem to work for me. Setting the transform to a CGAffineTransformMakeScale() can scale it up - not sure if that causes any other problems though.

David Neiss
  • 8,161
  • 2
  • 20
  • 21
0

To change the height of progressView try below code: ( works with Swift 5 )


progressView.transform = CGAffineTransform(scaleX: 1, y: 4) // y present the wanted height

and 1 present the current width, so if you change it to 3 then it will mean current width x 2

Let.Simoo
  • 93
  • 9