Class

iOSSlider


Warning

This item was deprecated in version 2020r2. Please use MobileSlider as a replacement.

Description

A control with a draggable slider than can be used to change a value.

Methods

Name

Parameters

Returns

Shared

AddConstraint

constraint As iOSLayoutConstraint

AddControl

child As MobileControl

Control

index As Integer

MobileControl

ControlCount

Integer

Handle

Ptr

Invalidate

RemoveConstraint

constraint As iOSLayoutConstraint

RemoveControl

child As MobileControl

SetMinCurrentMax

minValue As Double, currentValue As Double, maxValue As Double

SetTintColor

value As Color

Events

Name

Parameters

Returns

Close

Open

ValueChanged

Property descriptions


iOSSlider.AccessibilityHint

AccessibilityHint As Text

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

Me.AccessibilityHint = "Click to calculate the value and display the next view."

iOSSlider.AccessibilityLabel

AccessibilityLabel As Text

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

Me.AccessibilityLabel = "Calculate the value."

iOSSlider.Enabled

Enabled As Boolean

Enables or disables the slider.

Disable a Slider:

MySlider.Enabled = False

iOSSlider.Height

Height As Double

The height of the control.

This property is read-only.


iOSSlider.Left

Left As Double

The left position of the control.

This property is read-only.


iOSSlider.MaxValue

MaxValue As Double

The maximum value of the slider. The default value is 100.

Change the maximum slider value:

MySlider.MaxValue = 50

iOSSlider.MinValue

MinValue As Double

The minimum value of the slider. The default value is 0.

Change the minimum slider value:

MySlider.MinValue = -50

iOSSlider.Name

Name As Text

The name of the control. This can only be set in the Inspector. Use the name to refer to the control.

This property is read-only.


iOSSlider.Parent

Parent As iOSControl

Indicates the control's parent object, if it has one. If there is no parent, this is Nil.

This property is read-only.


iOSSlider.Top

Top As Double

The top position of the control.

This property is read-only.


iOSSlider.Value

Value As Double

The current value of the slider.

Set this value to move the slider position. If Value is greater than MaxValue, the MaxValue is used. If Value is less than MinValue, then MinValue is used.

Set the initial slider value:

MySlider.Value = 25

iOSSlider.Visible

Visible As Boolean

Indicates whether the control is visible.

Make a button invisible:

Button1.Visible = False

iOSSlider.Width

Width As Double

The width of the control.

This property is read-only.

Method descriptions


iOSSlider.AddConstraint

AddConstraint(constraint As iOSLayoutConstraint)

Adds a constraint to the control. This constraint is used by child controls that have been added to this control.


iOSSlider.AddControl

AddControl(child As MobileControl)

Adds a child control to the control.


iOSSlider.Control

Control(index As Integer) As MobileControl

Gets the child control at the specified index.


iOSSlider.ControlCount

ControlCount As Integer

The number of child controls in the control.


iOSSlider.Handle

Handle As Ptr

The handle is used to get a reference to the control for interfacing directly with the iOS API.


iOSSlider.Invalidate

Invalidate

Marks the control so that it will be redrawn during the next event loop.

Call Invalidate to force a Canvas to redraw itself:

Canvas1.Invalidate

iOSSlider.RemoveConstraint

RemoveConstraint(constraint As iOSLayoutConstraint)

Removes a constraint from the control.


iOSSlider.RemoveControl

RemoveControl(child As MobileControl)

Removes the control from the control.


iOSSlider.SetMinCurrentMax

SetMinCurrentMax(minValue As Double, currentValue As Double, maxValue As Double)

For convenience, sets all the properties at one time.

Sets values for the Slider:

MySlider.SetMinCurrentMax(-50, 25, 50)

iOSSlider.SetTintColor

SetTintColor(value As Color)

Changes a control's tint color. This varies by control and for some controls may not do anything. For example, with an MobileTextField this changes the cursor color.

Event descriptions


iOSSlider.Close

Close

Called when the control is removed from its container, such as a view.


iOSSlider.Open

Open

Called after the control is created. This is where you typically put initialization code.

Set label text in Open event:

Me.Text = "Hello"

iOSSlider.ValueChanged

ValueChanged

Called when CurrentValue is changed.

Update an iOSLabel with the value of the Slider as it changes:

MyTextField.Text = Me.Value.ToText

Compatibility

iOS projects on the iOS operating system.