xamarin-range-slider icon indicating copy to clipboard operation
xamarin-range-slider copied to clipboard

[Android] Object disposed exception

Open AshtonYoon opened this issue 6 years ago • 2 comments

IMPORTANT

If you are reporting a bug and want it to be fixed as soon as posible don't forget to provide a sample project.

image

My RangeSliderControl settings is below

Code

ratingSlider = FindViewById<RangeSliderControl>(Resource.Id.rating);
ratingSlider.ShowTextAboveThumbs = true;
ratingSlider.StepValueContinuously = true;
ratingSlider.StepValue = 1f;
ratingSlider.ActivateOnDefaultValues = true;
ratingSlider.MaterialUI = true;
ratingSlider.ShowLabels = true;
ratingSlider.SetRangeValues(0f, 5f);
ratingSlider.SetSelectedMinValue(0f);
ratingSlider.SetSelectedMaxValue(5f);
ratingSlider.FormatLabel = FormaLabel;
ratingSlider.TextAboveThumbsColor = Android.Graphics.Color.Black;

var density = Resources.DisplayMetrics.Density;
ratingSlider.SetBarHeight(density * 2);

XML

<xamarin.rangeslider.RangeSliderControl
                android:id="@+id/rating"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:absoluteMinValue="0"
                app:absoluteMaxValue="5"
                app:showRangeLabels="true"
                app:barHeight="1dp" />

RangeSliderControl throws System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Android.Graphics.Paint' When load view

I want to know why is throw this exception. Did I put the wrong value? or RangeSliderControls's bug?

Thank you for reading this issue :)

AshtonYoon avatar Mar 18 '19 08:03 AshtonYoon

+1 I'm also facing this issue.

hemantbeast avatar Apr 04 '19 10:04 hemantbeast

@AshtonYoon do you have a sample project?

halkar avatar Jul 27 '19 13:07 halkar