Xamarin.Forms: 从 HoloCircularProgressBar 中删除方形标记
Xamarin.Forms: Remove Square marker from HoloCircularProgressBar
我正在实施 Xamarin.Forms-Android-jamesmontemagno 的 CustomProgressBar:-
https://blog.xamarin.com/using-custom-controls-in-xamarin-forms-on-android/
如何去掉进度条启动时的方形标记,我不要方形标记
我尝试了 IsMarkerEnabled
属性 但它只是从进度条中删除了起始标记点。
您需要修改该控件的 source 以删除方形标记,因为它是硬编码的并且不是可选的。
//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();
我正在实施 Xamarin.Forms-Android-jamesmontemagno 的 CustomProgressBar:-
https://blog.xamarin.com/using-custom-controls-in-xamarin-forms-on-android/
如何去掉进度条启动时的方形标记,我不要方形标记
我尝试了 IsMarkerEnabled
属性 但它只是从进度条中删除了起始标记点。
您需要修改该控件的 source 以删除方形标记,因为它是硬编码的并且不是可选的。
//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();