How to assign different color to items in drop-down list in app designer?

조회 수: 26 (최근 30일)
Is it possible to provide different color to individual item in a drop-down list in app designer?
I have multiple entires in my drop down list. I want to assign either red or green font color to indiviual drop-down item based on my requirement.
How to do this?
  댓글 수: 2
Reshma Nerella
Reshma Nerella 2022년 4월 12일
이동: Adam Danz 2023년 3월 17일
Currently we do not support changing the color of individual items in drop down list in App Designer. I have brought this issue to the notice of the concerned people and it might be considered for a future release.
Nachiket Wadwankar
Nachiket Wadwankar 2022년 4월 14일
이동: Adam Danz 2023년 3월 17일
Thank you for the clarification.

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

채택된 답변

Jasmine Poppick
Jasmine Poppick 2023년 3월 17일
Starting in R2023a you can do this using the addStyle function.
In the StartupFcn callback of the app, you can create a style using uistyle and specify the BackgroundColor property, and then add the style to an item of the drop-down component. For example:
s = uistyle(BackgroundColor="green");
addStyle(app.DropDown,s,"item",2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by