4.8 KiB
id, title, category, permalink, original_id
| id | title | category | permalink | original_id |
|---|---|---|---|---|
| version-0.48-segmentedcontrolios | SegmentedControlIOS | Components | docs/segmentedcontrolios.html | segmentedcontrolios |
Use SegmentedControlIOS to render a UISegmentedControl iOS.
Programmatically changing selected index #
The selected index can be changed on the fly by assigning the selectIndex prop to a state variable, then changing that variable. Note that the state variable would need to be updated as the user selects a value and changes the index, as shown in the example below.
Props #
enabled?: bool #
If false the user won't be able to interact with the control. Default value is true.
momentary?: bool #
If true, then selecting a segment won't persist visually.
The onValueChange callback will still work as expected.
onChange?: function #
Callback that is called when the user taps a segment; passes the event as an argument
onValueChange?: function #
Callback that is called when the user taps a segment; passes the segment's value as an argument
selectedIndex?: number #
The index in props.values of the segment to be (pre)selected.
tintColor?: string #
Accent color of the control.
values?: [string] #
The labels for the control's segment buttons, in order.