[英]Adjust heigh for buttons in Viber bot
I need to display buttons in Viber bot using rich_media message type and Viber REST API.我需要使用rich_media消息类型和 Viber REST API 在 Viber 机器人中显示按钮。 When buttons are rendered the Rich Media element has a fixed height (see on screenshot).
呈现按钮时,富媒体元素具有固定高度(参见屏幕截图)。 If there is five buttons in Rich Media element some empty place appear under the last button.
如果 Rich Media 元素中有五个按钮,则最后一个按钮下方会出现一些空白位置。
My source sode for rendering buttons:我用于渲染按钮的源代码:
var reply = {
type: "raw",
method: "send_message",
body: {
receiver: $request.data.chatId,
sender:{
name: "John McClane",
avatar: "http://avatar.example.com"
},
min_api_version: 2,
type: "rich_media",
rich_media: {
Type: "rich_media",
Buttons: [
{
Rows: 1,
ActionBody: "Option 1",
ActionType: "reply",
Text: "Option 1"
},
{
Rows: 1,
ActionBody: "Option 2",
ActionType: "reply",
Text: "Option 2"
},
{
Rows: 1,
ActionBody: "Option 3",
ActionType: "reply",
Text: "Option 3"
},
...
]
}
}
}
I need to adjust the height of Rich Media element so the element stretches depending on the number of buttons.我需要调整 Rich Media 元素的高度,以便元素根据按钮的数量进行拉伸。 Is there a way to set height or disable default height of Rich Media element?
有没有办法设置高度或禁用富媒体元素的默认高度?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.