uiswitch
Crée un interrupteur (slider, rocker, toggle).
📝Syntaxe
h = uiswitch()
h = uiswitch(parent)
h = uiswitch(..., propertyName, propertyValue)
📥Arguments d'entrée
Paramètre Description
parent parent container.
propertyName, propertyValue name-value pairs.
📤Arguments de sortie
Paramètre Description
h UI component object.
📄Description

sw = uiswitch(parent, style) crée un interrupteur à deux états : styles 'slider' (défaut), 'rocker', 'toggle'. Items contient les deux libellés ; Value/ValueIndex/ItemsData suivent les règles habituelles ; ValueChangedFcn signale les changements.

💡Exemples
Capture du composant UI pour l'image d'aide.
f = uifigure('Visible', 'off', 'Name', 'Switches', 'Position', [100 100 520 300]);
sw = uiswitch(f, 'Position', [120 135 90 32]);
sw.Value = 'On';
rsw = uiswitch(f, 'rocker');
rsw.Position = [300 90 48 100];
rsw.Value = 'On';
drawnow();
Example illustration
uiswitch
f = uifigure();
sw = uiswitch(f, 'Items', {'Stop', 'Go'});
sw.Value = 'Go';
🔗Voir aussi
uifigure
🕔Historique des versions
Version Description
2.0.0 initial version
Modifier cette page sur GitHub