1

这是我正在使用的代码片段:

app.askWithCarousel('Which of these looks good?',
    app.buildCarousel()
        .addItems([
            app.buildOptionItem("SELECTION_KEY_ONE",
                ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2'])
                .setTitle('Number one'),
            app.buildOptionItem("SELECTION_KEY_TWO",
                ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2'])
                .setTitle('Number two'),
        ]));

这是屏幕截图:

在此处输入图像描述 在此处输入图像描述

4

1 回答 1

1

我找到了解决方案。这可能是谷歌的错误。您所要做的就是添加.setDescription方法

app.askWithCarousel('Which of these looks good?',
    app.buildCarousel()
        .addItems(
            app.buildOptionItem("SELECTION_KEY_ONE",
                            ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2'])
                            .setTitle('Number one')
                            .setDescription('Number one description')
            )
        .addItems(
            app.buildOptionItem("SELECTION_KEY_TWO",
                            ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2'])
                            .setTitle('Number two')
                            .setDescription('Number two description')
            )
);

更新

我刚刚发现不可能设置像.setDescription(''). 它返回一个错误。所以,我与空间相处.setDescription(' ')

于 2018-01-31T13:27:14.767 回答