Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
Images
Resources/Images.xcassets/LaunchImage.launchimage
AppDelegate.cs
Info.plist
README.md
Slider.csproj
Slider.sln
SliderViewController.cs

README.md

id title brief sdk
416B02DC-AA38-B2CD-27C7-0E4FB007BEAA
Specify Slider Value
This recipe shows how to specify the range of a slider and access its value.

Recipe

To create a slider and set its initial value:

  1. Create a UISlider and add it to the View:
slider = new UISlider(new CGRect(100,  30, 210, 20));
View.Add (slider);
  1. Set the slider minimum, maximum and initial value:
slider.MinValue = 0f;
slider.MaxValue = 1f;
slider.Value = 0.5f; // initial value
  1. Attach an event to respond to any changes in the slider:
slider.ValueChanged += HandleValueChanged; // defined below
  1. Create a method to handle the changed value. In the example the value is displayed in a label as the slider is dragged:
void HandleValueChanged (object sender, EventArgs e)
{   // display the value in a label
   label.Text = slider.Value.ToString ();
};

The sample looks like this when running: