Hi,
i am developping an app in app designer, but i am runing out of space for the drop down list. i wonder if there is a way to make a scrolling dropdown list, just like web pages when you want to go further down you just keep clicking on the rectangle think to the right of the screen.
this is my code :
list = load('Vehiclelist.mat');
assignin('base','list', list);
app.VehicleModelDropDown.Items = list.Vehiclelist;
Vehiclelist = [app.VehicleModelDropDown.Items New_Bat_Name];
save('Vehiclelist.mat','Vehiclelist','-append');
app.VehicleModelDropDown.Items = Vehiclelist;
%% scroll(app.VehicleModelDropDown.Items,1,1); %% << Somewhere here i want to put the
%% scrolling thing
thank you

댓글 수: 3

Adam Danz
Adam Danz 2020년 8월 31일
편집: Adam Danz 2020년 8월 31일
I don't believe that's supported, although the dropdown list will automatically create a vertical scroll bar after it gets too long, see Mario Malic's answer below. You could uses a listbox instead. It has a scroll feature and you can set it up to only accept 1 selection.
A more work-intesive method would be to set the max items at 8 (for example) and to set the 8th item in the dropdown list to "see more". When clicked, it loads the next 7 items in positions 1:7 while positon 8 remains "see more". It can circularly shift through the options.
Khalala Mamouri
Khalala Mamouri 2020년 8월 31일
Yes adam, i think it is easier with a list box. Please, is there a way make this list box show only one item, and when clicking on it (interact with ) it shows a list just like the fig bellow
thank you
Adam Danz
Adam Danz 2020년 8월 31일
No, I don't believe that's possible. You could shrink the height so that it only shows 1 item at a time but it will still only show 1 line at a time when scrolling through it.

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

답변 (1개)

Mario Malic
Mario Malic 2020년 8월 31일
편집: Mario Malic 2020년 8월 31일

1 개 추천

app.DisplayDropDown.Items = app.Legend_Str; % This is cell 1xn that contains char arrays
This works for me. I believe it appears when the items cannot fit the main window.
You don't have scrolling thing because, most likely you did not load all the data.

댓글 수: 1

Adam Danz
Adam Danz 2020년 8월 31일
+1, yes - once the list gets too long it will automatically add a vertical scoll bar.

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

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2020년 8월 31일

편집:

2020년 8월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by