简体   繁体   中英

How can i make an horizontal carousel in dialogflow?

When I try to create a carousel dynamically in dialogflow it appears vertically and with two items per row.

This is for a google assistant application, the actions on google documentation say that the carousel scrolls horizontally, but I can´t make it happen.


    for (let i = 0; i < data_JSON.length; i++) {


      let name;
      let imageurl;
      let venue;


      name =  datosJSON[i].nombre_evento
      imageurl = datosJSON[i].nombre_imagen;
      venue = name;


      items[i] = {
        optionInfo: {
          key: (i + 1).toString(),
          synonyms: name,
        },
        description: "Imagen "+i,
        title: name,
        url: imageurl,
        image: new Image({
          url: imageurl,
          alt: venue
        }),

      }

    }

    var carrusel = new Carousel({
         title: 'Search Items ',
         items: items
    });

   conv.ask(carrusel);
  });

I expect in google assistant only one row wich i can scroll horizontally, but i have multiple rows with 2 items per row.

轮播在智能显示器上水平显示,但在电话上使用2xN网格。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM