Class

iOSSegmentedControlItem


Warning

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

Description

An item to display within the SegmentedControl.

Properties

Name

Type

Read-Only

Shared

Icon

iOSImage

Selected

Boolean

Title

Text

Width

Double

Methods

Name

Parameters

Returns

Shared

Constructor

icon As Picture

Constructor

title As String = ""

Property descriptions


iOSSegmentedControlItem.Icon

Icon As iOSImage

The icon to display.

Although you can have both an Icon and a Title, iOS only shows one of them, preferring the icon if available.

If you use an icon that is too large (about 28x28 seems to be the maximum), you will only see an empty square.

Only the mask for the icon is used, displayed using the tint color for iOS (currently blue), so be sure to use a PNG with an alpha channel.

Changes the icon for the first segment:

MySegmentedControl.Item(0).Icon = MyNewIcon

iOSSegmentedControlItem.Selected

Selected As Boolean

Indicates if the item is selected.

Only one segment can display as selected. If multiple segments have Selected = True, then the last one with Selected = True is the one that displays as selected.

Set the first segment as selected:

MySegmentedControl.Item(0).Selected = True

iOSSegmentedControlItem.Title

Title As Text

The title text of the item.

Although you can have both an Icon and a Title, iOS only shows one of them, preferring the icon if available.

Changes the title for the first segment:

MySegmentedControl.Item(0).Title = "First!"

iOSSegmentedControlItem.Width

Width As Double

The width of the item in points. Leave at 0 to have the segment use the available space. If the widths of all segments are 0, then the space will be divided equally amongst the segments.

Change the first segment width:

MySegmentedControl.Item(0).Width = 50

Method descriptions


iOSSegmentedControlItem.Constructor

Constructor(icon As Picture)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates an item using the specified image.


iOSSegmentedControlItem.Constructor

Constructor(title As String = "")

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates an item using the optional title.

In the Open event handler of an iOSSegmentedControl, adds a segment with a title:

Me.Add(New iOSSegmentedControlItem("Moon"))

Compatibility

iOS projects on the iOS operating system.

See also

Object parent class; MobileSegmentedButton