Xamarin-Forms-RadialProgress
Xamarin-Forms-RadialProgress copied to clipboard
[Bug][iOS] Canvas not redrawing
I have a slightly modified code based on your approach, but on iOS I can't get the progress bar to be redrawn. On Android everything works fine.
<Slider x:Name="sweepAngleSlider"
ValueChanged="sliderValueChanged"
Minimum="0"
Maximum="360"
IsVisible="false" />
I noticed that sliderValueChanged is not fired, and then even if I call it after every progress update canvas is not redrawn. Basically, this code does nothing:
void sliderValueChanged(object sender, ValueChangedEventArgs args)
{
if (canvasView != null)
{
canvasView.InvalidateSurface();
}
}
I don't know why it fails only on iOS. What could I possibly try to find the problem?
The workaround is not to assign a value to sweepAngleSlider in code, but to bind its value to a property like this:
<Slider x:Name="sweepAngleSlider"
Value="{Binding SliderValue}"
ValueChanged="sliderValueChanged"
Minimum="0"
Maximum="360"
IsVisible="false" />