Forum Xamarin.iOS

How to make ProgressView height the default when adding programmatically.

PhunctionPhunction CAMember ✭✭

When I programmatically add a progress view, it displays extremely thin.
Is there a way to make it the normal height like when you add it to the storyboard via the visual editor?
This is what I have so far:
CGRect rect1 = new CGRect(10, 50, 100, 30);
prgProgress = new UIProgressView(rect1);
prgProgress.Progress = 1;
prgProgress.ContentMode = UIViewContentMode.ScaleToFill;

Not sure why doing it this way makes it about 1/10th the height?


Best Answer


  • PhunctionPhunction CAMember ✭✭

    Great, that works, thanks.

  • RobertDalyRobertDaly USMember ✭✭

    LandLu, many thanks for your solution! I have been searching for days for a way to change the height of my progress bar and your solution worked like a charm!!!

Sign In or Register to comment.