image 组件如何做到高度自适应?

发布于 8 年前作者 songxiulan13936 次浏览最后编辑 8 年前来自 issues

在开发小程序发现image组件高度不能自适应,请问各位大神是如何解决的呢

3 回复
houyong
houyong1 楼6 年前

只要设置宽度就行了,

链接:https://developers.weixin.qq.com/miniprogram/dev/component/image.html

记得点赞喔

etao
etao2 楼6 年前

你好!

可以试试加个属性 mode=“widthFix” 。

vlei
vlei3 楼6 年前

height:auto;无法适应吗?或者https://developers.weixin.qq.com/miniprogram/dev/component/image.html

看下mode属性