user666
user666

Reputation: 332

How to make a progressbar with a icon?

I know how to set the width of the progressBar by renderer it in ios/android.But is there anyway to add a image in the progressbar?

I have set its height.

protected override void OnElementChanged(ElementChangedEventArgs<ProgressBar> e)
        {
            base.OnElementChanged(e);

            Control.ScaleY = 20;
        }

and in ios:

public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            var x = 1.0f;
            var y = 20.0f;

            CGAffineTransform transform = CGAffineTransform.MakeScale(x, y);
            Control.Transform = transform;
        }

but I wonder if there is anyway to add an icon? this is my goal to achive: progressBar it is a 98 percent progressBar with a star in the end of the progress value.I've no idea to achive it

Upvotes: 0

Views: 217

Answers (2)

Leo Zhu
Leo Zhu

Reputation: 15031

Maybe it's too late to reply now

Have you try to use Slider and use CustomRender to custom the style of SeekBar,it has the android:thumb="@drawable/seekbarthumb" attribute,set your star icon to the thumb more easily

Upvotes: 0

user666
user666

Reputation: 332

at last I use relativelayout to fix the postion of the image. as @Skin says.

Upvotes: 0

Related Questions