为什么Appdesigner里的UItable没有显示行名称?
40 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 24 Set 2020
Risposto: MathWorks Support Team
il 24 Set 2020
我在Appdesigner里加入了一个UItable,我希望显示行名称。我在属性面板上设置了,但运行app后,没有显示。见截图,我该怎么处理?
Risposta accettata
MathWorks Support Team
il 24 Set 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 使用 App 设计工具开发 App in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!