Himanshu Dwivedi
Himanshu Dwivedi

Reputation: 8124

Xamarin.Forms: Remove Square marker from HoloCircularProgressBar

I am implementing Xamarin.Forms-Android-CustomProgressBar of jamesmontemagno:-

https://blog.xamarin.com/using-custom-controls-in-xamarin-forms-on-android/

How to remove the square marker from the progress bar when it starts, I don't want the square marker.

I tried IsMarkerEnabled property but it only removed the starting marker point from the progress bar.

enter image description here

Upvotes: 0

Views: 122

Answers (1)

SushiHangover
SushiHangover

Reputation: 74209

You would need to modified the source of that control to remove the square marker as it is hardcoded and not optional.

//draw the thumb square at the correct rotated position
canvas.Save();
canvas.Rotate(progressRotation - 90);
//rotate the square by 45 degrees
canvas.Rotate(45, thumbPosX, thumbPosY);
var rect = new RectF();
rect.Left = thumbPosX - thumbRadius / 3.0f;
rect.Right = thumbPosX + thumbRadius / 3.0f;
rect.Top = thumbPosY - thumbRadius / 3.0f;
rect.Bottom = thumbPosY + thumbRadius / 3.0f;
canvas.DrawRect(rect, thumbColorPaint);
canvas.Restore();

https://github.com/jamesmontemagno/MonoDroidToolkit/blob/master/src/MonoDroidToolkit/HoloCircularProgressBar.cs#L286

Upvotes: 1

Related Questions