图片未显示在Google行动中的表格回应中

时间:2019-03-21 10:26:01

标签: dialogflow actions-on-google

//class should look like this ...
public class Artist {
    String artistName;
    //other attributes

    //create constructor
    public Artist(String name){
        this.artistName = name;    
    }
}


//Next two line can be placed in other class 
//(e.g. 1st line in class containing main function and 2st line in main function)
//create object/instance of class
Artist artist = new Artist(name);

//Use create instance of that class
System.out.println(artist.artistName);

我已经添加了此代码,我能够看到具有给定字段的表,但是图像没有出现在表中,而是即使图像是https URL,也会出现此错误。

conv.ask(new Table({ title: 'Emissions due to different gases', // subtitle: 'Table Subtitle', image: new Image({ uri: 'https://www.scienceabc.com/wp-content/uploads/2015/05/Walking-in-Rain.jpg', alt: 'Emissions Image' }), columns: [ { header: 'CO2', align: 'CENTER', }, { header: 'CH4', align: 'CENTER', }, { header: 'N20', align: 'CENTER', }, ], rows: [ // { // cells: [carbonEmission, methaneEmission, nitrousEmission], // dividerAfter: true, // }, { cells: ['row 2 item 1', 'row 2 item 2', 'row 2 item 3'], dividerAfter: true, }, { cells: ['row 2 item 1', 'row 2 item 2', 'row 2 item 3'], }, ], buttons: new Button({ title: 'Read More', url: 'https://assistant.google.com' }),

1 个答案:

答案 0 :(得分:1)

我认为问题在于Image类中的属性可能应该称为url and not uri