Microsoft Teams安卓端Adaptive Card text overflow导致提交被拒如何解决
适配修复方案
- 调整自适应卡片版本至1.2。你使用的1.3版本在对应版本的Teams安卓客户端中存在属性兼容bug,降级可直接解决多数渲染异常问题。
- 为所有带
wrap: true的TextBlock显式添加"maxWidth": "100%"属性,避免安卓端无法自动计算容器宽度触发换行。 - 取消首条TextBlock外层的冗余Container嵌套,安卓端对多层嵌套容器的宽度计算存在偏差,直接将TextBlock放在body节点下即可。
- 为
style: expanded的Input.ChoiceSet也添加"maxWidth": "100%"属性,避免多选组件撑宽容器,连带卡片出现横向滚动条。
修复后完整JSON代码
{ "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.2", "body": [ { "type": "TextBlock", "text": "Awesome! 👍", "wrap": true, "size": "large", "weight": "bolder", "maxWidth": "100%" }, { "type": "TextBlock", "text": "Let's add some tags and notes to make it more memorable", "wrap": true, "maxWidth": "100%" }, { "type": "Input.ChoiceSet", "choices": [ { "title": "Work", "value": "1" }, { "title": "Kids", "value": "2" } ], "id": "tags", "label": "What influences your current mood?", "style": "expanded", "isMultiSelect": true, "maxWidth": "100%" }, { "type": "TextBlock", "text": "Any notes that you would like to add", "wrap": true, "maxWidth": "100%" }, { "type": "Input.Text", "placeholder": "Write something...", "id": "notes", "isMultiline": true, "maxWidth": "100%" }, { "type": "Input.Text", "value": "1", "id": "moodId", "isVisible": false } ], "actions": [ { "type": "Action.Submit", "title": "Submit" } ] }
内容的提问来源于stack exchange,提问作者Joaquín L. Robles
相关产品推荐
相关产品推荐

