2
votes

I have been developing a Xamarin forms application. I want to increase the height of the progress bar control. I used custom renders to change the color of the progress control. But I couldn't find any way to increase the height. Please help me. following is my Custom render class.

public class MyProgressBarRenderer:ProgressBarRenderer
{
    protected override void OnElementChanged (
         ElementChangedEventArgs<Xamarin.Forms.ProgressBar> e)
    {
        base.OnElementChanged (e);

        Control.ProgressTintColor =  Color.FromHex ("#254f5e").ToUIColor();
    }
}
2

2 Answers

1
votes

Add this override to MyProgressBarRenderer, and adjust Y as necessary....

using UIKit; 
using CoreGraphics;
......
public override void LayoutSubviews()
{
   base.LayoutSubviews();

   var X = 1.0f;
   var Y = 5.0f;

   CGAffineTransform transform = CGAffineTransform.MakeScale(X,Y);
   this.Transform = transform; 
}

enter image description here

0
votes

There is small issue in the iOS renderer code try using

this.Control.Transform = transform; 

instead of

this.Transform = transform;