为什么Appdesigner里的UItable没有显示行名称?
45 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 24 Sep. 2020
Beantwortet: MathWorks Support Team
am 24 Sep. 2020
我在Appdesigner里加入了一个UItable,我希望显示行名称。我在属性面板上设置了,但运行app后,没有显示。见截图,我该怎么处理?
Akzeptierte Antwort
MathWorks Support Team
am 24 Sep. 2020
原因是table表格中没有数据。添加数据后,就可以显示行名称了。具体的操作:
1)进入代码页面 code view
2)工具栏上点击 callback
3)选择 UIFigure
4)在具体 callback 中选择 startupFcn
5)点击 add callback
6)此时会自动生成 function,在其中添加代码,例如:
myData={'Andrew' 31 'Male' 'Choose';...
'Bob' 41 'Male' 'Choose';...
'Anne' 20 'Female' 'Choose'};
app.UITable.Data=myData;
此时运行app时,因为启动时自动加载数据,因此行名称可以显示。
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 使用 App 设计工具开发 App finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!