Image 组件使用 svg 时,不支持伸缩吗?
尝试 svg 的时候,发现 svg 保持了纵横比,没有填满宽度,修改 mode 也无效,换其它图片格式的话 mode 是有起效的。
2 回复
<? xml version = "1.0" encoding = "UTF-8" ?> < svg width = "750px" height = "560px" viewBox = "0 0 750 560" version = "1.1" xmlns = "http://www.w3.org/2000/svg" xmlns:xlink = "http://www.w3.org/1999/xlink" > <!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch --> < title >两列</ title > < desc >Created with Sketch.</ desc > < g id = "两列" stroke = "none" stroke-width = "1" fill = "none" fill-rule = "evenodd" > < rect fill = "#FFFFFF" x = "0" y = "0" width = "750" height = "560" ></ rect > < polygon id = "矩形" fill = "#F0F0F0" fill-rule = "nonzero" points = "20 10 370.649351 10 370.649351 550 20 550" ></ polygon > < polygon id = "矩形-copy" fill = "#F0F0F0" fill-rule = "nonzero" points = "380 10 730.649351 10 730.649351 550 380 550" ></ polygon > </ g > </ svg > |
这是那个 svg,在小程序 IDE 里,image 有样式宽高 100%,父容器的宽高比大于 svg 的宽高比,然后 svg 填满了高度,但没填满宽度,保持了纵横比,可以一试
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)