Any way to show two widget side by side in gmail add on?

青春壹個敷衍的年華 提交于 2019-12-11 08:58:32

问题


I am creating a gmail add on -
Requirement
I want to include a button and key value add-on on the same row -
Status
Currently only one widget can be shown on 1 line

Is there any way to show two widgets side by side ?


回答1:


Take a look at the screenshot below

[

1

We got around this by adding a setOnClickAction and setButton method on a key value pair.

Both "Activities" and "+New" are clickable and perform different actions.

activitiesListSection.addWidget(CardService.newKeyValue()
                                      .setContent("<b>Activities</b>")
                                      .setOnClickAction(saveAction)
                                      .setButton(CardService.newTextButton()
                                                 .setText("+ New")
                                                 .setOnClickAction(saveAction))
                                      .setIcon(CardService.Icon.DESCRIPTION));


来源:https://stackoverflow.com/questions/50268166/any-way-to-show-two-widget-side-by-side-in-gmail-add-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!