Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

ProgressBar height changed but now width is messed up

$
0
0

Hi everybody,

I created a custom renderer to increase the height of my progress bar which works fine, the code is below,

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

        Control.ProgressTintColor = UIColor.Red;
        Control.TrackTintColor = UIColor.Black;

        UIImage progress = new UIImage("progress.png");

    }

    public override void LayoutSubviews()
    {
        CGAffineTransform transform = CGAffineTransform.MakeScale(1.0f, 10.0f);
        this.Transform = transform; 
    }

However, now the progress bar is a bit small, and I can't fin a way to make it fit the screens width again. if I change the first float on the makeScale property i only get it to move on the x axis and the size does not increase. Dos anybody have any ideas on how to do this?

attached is the image of how the bar looks now, all I need it to do now is to fit the width.

Tried width request on forms but does nothing, and on the renderer I can't find a property that helps me do this.

any ideas?

Thanks!


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>