Change the Color of the Switch in the app designer?

30 次查看(过去 30 天)
I am using app designer and I would like to change the color of the switches. Available switch options were 'Rocker Switch', 'Toggle Switch' and 'Switch' but neither of them has a .Color attribute.
I know I can use a lamp instead to display the status of the switch but I would like to change the color of the switch if possible.
Or I would like to have 'On' or 'Off' but only one of the two visible when the switch is in either of the states.
Thanks in advance!

采纳的回答

Timor
Timor 2021-7-8
I added a lamp on top of the switch at the "on" position that is visible only when switch value is "on". works nice.
  2 个评论
Liam Vanderschaaf
Love this idea, but how did you do it? Whenever I try to drag a lamp onto the switch, the switch gets replaced.
Maruan Alberto Bracci
Then you can't click the lamp to turn off the switch, but you have to click in the gray area. Does it have the same behavior for you too?

请先登录,再进行评论。

更多回答(1 个)

Reshma Nerella
Reshma Nerella 2021-6-11
Hi,
Currently we do not support Color property for Switch components. I have brought this issue to the notice of the concerned people and it might be considered for a future release.

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by