为什么Appdesi​gner里的UIta​ble没有显示行名称​?

29 views (last 30 days)
我在Appdesigner里加入了一个UItable,我希望显示行名称。我在属性面板上设置了,但运行app后,没有显示。见截图,我该怎么处理?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 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时,因为启动时自动加载数据,因此行名称可以显示。

More Answers (0)

Categories

Find more on 使用 App 设计工具开发 App in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!