app designer switch problem
Mostrar comentarios más antiguos
Hello community!
I want to use a switch to control the UI theme, like light mode and dark mode. But I can only switch it once, the second time I click, no response. Here are the codes:
% Value changed function: Switch2
function Switch2ValueChanged(app, event)
value = app.Switch2.Value;
if value
app.UIFigure.Color = [0.5, 0.5, 0.5];
else
app.UIFigure.Color = [1, 1, 1];
end
end
related photos, before I click:

after I click:

However, it can only work once. Can you help me, please?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre LaTeX en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!