0

I've set track image and progress image using [UIProgressView appearance]. Images set, but height of UIProgressView didn't change. It changes only after rotating device to lanscape. Where could be problem? Setting UIProgressView's frame doesn't help.

//image size 13x13 px.
[[UIProgressView appearance] setProgressImage:[[UIImage imageNamed:@"UploadingProgress_1.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 6, 6, 6)]];
[[UIProgressView appearance] setTrackImage:[[UIImage imageNamed:@"Uploading_1.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 6, 6, 6)]];

SOLVED with [[UIProgressView appearance] setFrame:] method.

Timur Mustafaev
  • 4,869
  • 9
  • 63
  • 109

1 Answers1

0

Make sure the view (or at least the rectangle you care about) is being redrawn when you set the appearance. Call the method setNeedsDisplay whenever you set the appearance. The height of your UIProgressView would change on autorotation, because your views are re-laid out and redrawn when you rotate.

Dylan Kirkby
  • 1,427
  • 11
  • 19