为什么标签不在对话框中显示在dm脚本中?
当我用三个制表符(和一个表格布局)创建一个简单的对话框时,标签就不会出现。下面的对话框显示:

我期待的是这样的事情:

我使用了以下示例代码:
class TestDialog : UIFrame{
TagGroup createContent(object self){
number total_length = 3
TagGroup tabs = DLGCreateTabList(total_length);
for(number i = 0; i < total_length; i++){
TagGroup content = DLGCreateGroup();
content.DLGLayout(DLGCreateTableLayout(3, 1, 0));
TagGroup l = DLGCreateLabel("Row 1 of tab " + (i + 1));
content.DLGAddElement(l);
TagGroup v = DLGCreateLabel("Row 2 of tab " + (i + 1));
content.DLGAddElement(v);
TagGroup c = DLGCreateCheckBox("Checkbox of tab " + (i + 1));
content.DLGAddElement(c);
TagGroup tab = tabs.DLGAddTab("Tab " + (i + 1));
tab.DLGAddElement(content);
}
return tabs;
}
object init(object self){
return self.super.init(self.createContent())
}
}
object dialog = alloc(TestDialog).Init();
dialog.pose();发布于 2020-04-28 09:44:35
好吧,我发现了。似乎添加了一个制表符列表,因为对话框的直接子程序不起作用。标签列表周围需要有一个组。

class TestDialog : UIFrame{
TagGroup createContent(object self){
number total_length = 3
TagGroup tabs = DLGCreateTabList(total_length);
for(number i = 0; i < total_length; i++){
TagGroup content = DLGCreateGroup();
// ...
TagGroup tab = tabs.DLGAddTab("Tab " + (i + 1));
tab.DLGAddElement(content);
}
// this is the important part
TagGroup wrapper = DLGCreateGroup();
wrapper.DLGAddElement(tabs);
return wrapper;
}
object init(object self){
return self.super.init(self.createContent())
}
}
object dialog = alloc(TestDialog).Init();
dialog.pose();https://stackoverflow.com/questions/61477040
复制相似问题