Change the Color of the Switch in the app designer?

조회 수: 36 (최근 30일)
Jay Vaidya
Jay Vaidya 2021년 6월 8일
댓글: aamir ibrahim 2024년 9월 9일
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
Liam Vanderschaaf 2022년 1월 7일
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
Maruan Alberto Bracci 2023년 1월 18일
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.
  댓글 수: 3
Jiri Hajek
Jiri Hajek 2022년 5월 11일
This would be much appreciated...
aamir ibrahim
aamir ibrahim 2024년 9월 9일
Is this available now? I am working with 2023a and still don't see this.

댓글을 달려면 로그인하십시오.

카테고리

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