多个控件在一行

如果想两个控件显示在 1 行,第一个控件需要写 width 和 nowrap 参数(参数内容为 1 ),第二个控件需要写 width 参数。 如果想 n(数量大于 2 )个控件在一行,第一个控件至第(n - 1)个控件都需要写 width 和 nowrap 参数(参数内容为 1 ),第 n 个控件需要写 width 参数。

参数 类型 说明
width string 控件宽度,需要自己调整宽度
nowrap string 指定下一个控件是否换行,默认换行,1 为不换行

以编辑框为例

script.json 文件内容:

需要创建 script.json 文件并将以下代码复制到创建的文件中

{
"params": [{
                    "id": "数字1",
                    "type": "Edit",
                    "prompt": "请输入一个数字",
                    "text": "1",
                    "kbtype": "number",
                    "width": "200",
                    "nowrap": "1"
            },
            {
                    "id": "数字2",
                    "type": "Edit",
                    "prompt": "请输入一个数字",
                    "text": "2",
                    "kbtype": "number",
                    "width": "200"
            }]
}

lua 文件内容:

dialog(数字1)
dialog(数字2)
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""