2

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();
    }
}
valdetero
  • 4,624
  • 1
  • 31
  • 46
Aneesh.A.M
  • 1,128
  • 4
  • 17
  • 35

2 Answers2

1

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

iupchris10
  • 453
  • 3
  • 14
0

There is small issue in the iOS renderer code try using

this.Control.Transform = transform; 

instead of

this.Transform = transform;
  • I tried the same but this happened http://stackoverflow.com/questions/42391200/xamarin-forms-progressbar-height-issue-in-ios – Sonali Apr 25 '17 at 07:02
  • Try the code I shared on http://stackoverflow.com/questions/42391200/xamarin-forms-progressbar-height-issue-in-ios/43632035#43632035 – NoumanUllah SiddiquI Apr 26 '17 at 10:49