user2823044
user2823044

Reputation: 315

How to change height of uiprogressview

I am trying to change the UIProgressView height through nib and programatic also. But it can't changed. So give some suggestion how to handle it.

Thanks in advance.

Upvotes: 0

Views: 4533

Answers (4)

Pandurang Yachwad
Pandurang Yachwad

Reputation: 1723

In Swift 3, it's changed to CGAffineTransform(scaleX: CGFloat, y: CGFloat). So code would be:

progressView.transform = CGAffineTransform(scaleX: 1, y: 4)

Upvotes: 2

Mitchell Hart
Mitchell Hart

Reputation: 1

I've found another answer that works better for me. Set your width and height manually.

self.progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; [self.progressView setFrame:CGRectMake(0, 0, self.view.frame.size.width, 11)];

[self.view addSubview:self.progressView];

Upvotes: 0

yoeriboven
yoeriboven

Reputation: 3571

UIProgressView has a fixed height. You can change the width though. There are a lot of custom progressviews out there you could try.

Upvotes: 0

Kujey
Kujey

Reputation: 1122

This is the trick : chose scale according to the new height you want and then write this in your code :

self.progressView.tranform = CGAffineTransformMakeScale(1.0, scale);

Upvotes: 2

Related Questions